summaryrefslogtreecommitdiffstats
path: root/tests/textWind.test
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2025-05-23 02:28:37 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2025-05-23 02:28:37 (GMT)
commit25f16a070dd42bc33af26334d2071a81377aee5c (patch)
treef20dcb1268a10aa292953f0ffa965881fefed78b /tests/textWind.test
parente1675428ff056ed7a44fcc26a26dc5adb8e5f9eb (diff)
parentf8e4b115fdb0f0886cd853323937b8ea757fcc21 (diff)
downloadtk-core-tip-716.zip
tk-core-tip-716.tar.gz
tk-core-tip-716.tar.bz2
Merge core-9-0-branchcore-tip-716
Diffstat (limited to 'tests/textWind.test')
-rw-r--r--tests/textWind.test37
1 files changed, 9 insertions, 28 deletions
diff --git a/tests/textWind.test b/tests/textWind.test
index 56525fd..83d58c1 100644
--- a/tests/textWind.test
+++ b/tests/textWind.test
@@ -11,12 +11,10 @@ namespace import ::tcltest::*
tcltest::configure {*}$argv
tcltest::loadTestedCommands
-deleteWindows
+# Import utility procs for specific functional areas
+testutils import text
-set fixedFont {Courier -12}
-set fixedHeight [font metrics $fixedFont -linespace]
-set fixedWidth [font measure $fixedFont m]
-set fixedAscent [font metrics $fixedFont -ascent]
+deleteWindows
# On Windows at least, the tests do work with {Courier -10}, {Courier -12} or {Courier -14} as fixedFont.
# Warn the user if the actual font is too different from what was requested.
@@ -49,27 +47,6 @@ update
wm geometry . {}
-# full border size of the text widget, i.e. first x or y coordinate inside the text widget
-# warning: -padx is supposed to be the same as -pady (same border size horizontally and
-# vertically around the widget)
-proc bo {{w .t}} {
- return [expr {[$w cget -borderwidth] + [$w cget -highlightthickness] + [$w cget -padx]}]
-}
-# x-width of $n chars, fixed width font
-proc xw {n} {
- global fixedWidth
- return [expr {$n * $fixedWidth}]
-}
-# x-coordinate of the first pixel of $n-th char (count starts at zero), left justified
-proc xchar {n {w .t}} {
- return [expr {[bo $w] + [xw $n]}]
-}
-# y-coordinate of the first pixel of $l-th display line (count starts at 1)
-proc yline {l {w .t}} {
- global fixedHeight
- return [expr {[bo $w] + ($l - 1) * $fixedHeight}]
-}
-
set color [expr {[winfo depth .t] > 1 ? "green" : "black"}]
# The statements below reset the main window; it's needed if the window
@@ -1666,8 +1643,12 @@ test textWind-18.3 {embedded window destruction in cascade} -setup {
destroy .t .f
} -result {}
-option clear
-# cleanup
+#
+# CLEANUP
+#
+
+option clear
+testutils forget text
cleanupTests
return