summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-08-21 21:55:21 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-08-21 21:55:21 (GMT)
commit526bfaf3b95e61d1c8501e5ce57bbb8d0e6ad263 (patch)
treefed0468eb95057c0e462609d204862fb2ac5ee64 /tests
parent7ec63213fa5f13b7e9cfe8675d56b1b2c7672ef4 (diff)
parentd7604070f38c8f5845e36c5893a451741a17912a (diff)
downloadtk-526bfaf3b95e61d1c8501e5ce57bbb8d0e6ad263.zip
tk-526bfaf3b95e61d1c8501e5ce57bbb8d0e6ad263.tar.gz
tk-526bfaf3b95e61d1c8501e5ce57bbb8d0e6ad263.tar.bz2
Merge 8.7 (which now contains glyph_indexing_2 branch)
Diffstat (limited to 'tests')
-rw-r--r--tests/bind.test17
-rw-r--r--tests/cluster.test246
2 files changed, 263 insertions, 0 deletions
diff --git a/tests/bind.test b/tests/bind.test
index 116405a..733ddb5 100644
--- a/tests/bind.test
+++ b/tests/bind.test
@@ -5496,6 +5496,23 @@ test bind-25.53 {modifier names} -setup {
destroy .t.f
} -result <B9-Key-a>
+test bind-25.54 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <Num-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <Mod3-Key-a>
+
+test bind-25.55 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <Fn-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <Mod4-Key-a>
test bind-26.1 {event names} -setup {
diff --git a/tests/cluster.test b/tests/cluster.test
new file mode 100644
index 0000000..32e4c63
--- /dev/null
+++ b/tests/cluster.test
@@ -0,0 +1,246 @@
+# This file is a Tcl script to test the [::tk::startOf|endOf]* functions in
+# tk.tcl and tkIcu.c. It is organized in the standard fashion for Tcl tests.
+#
+# Copyright © 1994 The Regents of the University of California.
+# Copyright © 1994-1995 Sun Microsystems, Inc.
+# Copyright © 1998-1999 Scriptics Corporation.
+# All rights reserved.
+
+package require tcltest 2.2
+eval tcltest::configure $argv
+tcltest::loadTestedCommands
+namespace import -force tcltest::test
+
+testConstraint needsTcl87orICU [expr {[package vsatisfies [package provide Tcl] 8.7] || [catch {info body ::tk::startOfCluster}]}]
+
+
+test cluster-1.0 {::tk::startOfCluster} -body {
+ ::tk::startOfCluster 🤡 -1
+} -result {}
+test cluster-1.1 {::tk::startOfCluster} -body {
+ ::tk::startOfCluster 🤡 0
+} -result 0
+test cluster-1.2 {::tk::startOfCluster} -constraints needsTcl87orICU -body {
+ ::tk::startOfCluster 🤡 1
+} -result 0
+test cluster-1.3 {::tk::startOfCluster} -constraints needsTcl87orICU -body {
+ ::tk::startOfCluster 🤡 2
+} -result 2
+test cluster-1.4 {::tk::startOfCluster} -constraints needsTcl87orICU -body {
+ ::tk::startOfCluster 🤡 3
+} -result 2
+test cluster-1.5 {::tk::startOfCluster} -constraints needsTcl87orICU -body {
+ ::tk::startOfCluster 🤡 end
+} -result 0
+test cluster-1.6 {::tk::startOfCluster} -body {
+ ::tk::startOfCluster 🤡 {}
+} -result {}
+test cluster-1.7 {::tk::startOfCluster} -constraints needsTcl87orICU -body {
+ ::tk::startOfCluster 🤡 end-1
+} -result 0
+
+test cluster-2.0 {::tk::endOfCluster} -body {
+ ::tk::endOfCluster 🤡 -1
+} -result 0
+test cluster-2.1 {::tk::endOfCluster} -constraints needsTcl87orICU -body {
+ ::tk::endOfCluster 🤡 0
+} -result 2
+test cluster-2.2 {::tk::endOfCluster} -constraints needsTcl87orICU -body {
+ ::tk::endOfCluster 🤡 1
+} -result 2
+test cluster-2.3 {::tk::endOfCluster} -body {
+ ::tk::endOfCluster 🤡 2
+} -result {}
+test cluster-2.4 {::tk::endOfCluster} -body {
+ ::tk::endOfCluster 🤡 3
+} -result {}
+test cluster-2.5 {::tk::endOfCluster} -constraints needsTcl87orICU -body {
+ ::tk::endOfCluster 🤡 end
+} -result 2
+test cluster-2.6 {::tk::endOfCluster} -body {
+ ::tk::endOfCluster 🤡 {}
+} -result 0
+test cluster-2.7 {::tk::endOfCluster} -constraints needsTcl87orICU -body {
+ ::tk::endOfCluster 🤡 end-1
+} -result 2
+
+test cluster-3.0 {::tk::endOfWord} -body {
+ ::tk::endOfWord "ab cd" -1
+} -result 2
+test cluster-3.1 {::tk::endOfWord} -body {
+ ::tk::endOfWord "ab cd" 0
+} -result 2
+test cluster-3.2 {::tk::endOfWord} -body {
+ ::tk::endOfWord "ab cd" 1
+} -result 2
+test cluster-3.3 {::tk::endOfWord} -body {
+ ::tk::endOfWord "ab cd" 2
+} -result {}
+test cluster-3.4 {::tk::endOfWord} -body {
+ ::tk::endOfWord "ab cd" 3
+} -result {}
+test cluster-3.5 {::tk::endOfWord} -body {
+ ::tk::endOfWord "ab cd" 4
+} -result {}
+test cluster-3.6 {::tk::endOfWord} -body {
+ ::tk::endOfWord "ab cd" 5
+} -result {}
+test cluster-3.7 {::tk::endOfWord} -body {
+ ::tk::endOfWord "ab cd" end
+} -result {}
+test cluster-3.8 {::tk::endOfWord} -body {
+ ::tk::endOfWord "ab cd" {}
+} -result 2
+test cluster-3.9 {::tk::endOfWord} -body {
+ ::tk::endOfWord "ab cd" end-1
+} -result {}
+
+test cluster-4.0 {::tk::startOfPreviousWord} -body {
+ ::tk::startOfPreviousWord "ab cd" -1
+} -result {}
+test cluster-4.1 {::tk::startOfPreviousWord} -body {
+ ::tk::startOfPreviousWord "ab cd" 0
+} -result {}
+test cluster-4.2 {::tk::startOfPreviousWord} -body {
+ ::tk::startOfPreviousWord "ab cd" 1
+} -result 0
+test cluster-4.3 {::tk::startOfPreviousWord} -body {
+ ::tk::startOfPreviousWord "ab cd" 2
+} -result 0
+test cluster-4.4 {::tk::startOfPreviousWord} -body {
+ ::tk::startOfPreviousWord "ab cd" 3
+} -result 0
+test cluster-4.5 {::tk::startOfPreviousWord} -body {
+ ::tk::startOfPreviousWord "ab cd" 4
+} -result 3
+test cluster-4.6 {::tk::startOfPreviousWord} -body {
+ ::tk::startOfPreviousWord "ab cd" 5
+} -result 3
+test cluster-4.7 {::tk::startOfPreviousWord} -body {
+ ::tk::startOfPreviousWord "ab cd" end
+} -result 3
+test cluster-4.8 {::tk::startOfPreviousWord} -body {
+ ::tk::startOfPreviousWord "ab cd" {}
+} -result {}
+test cluster-4.9 {::tk::startOfPreviousWord} -body {
+ ::tk::startOfPreviousWord "ab cd" end-1
+} -result 0
+
+test cluster-5.0 {::tk::startOfNextWord} -body {
+ ::tk::startOfNextWord "ab cd" -1
+} -result 3
+test cluster-5.1 {::tk::startOfNextWord} -body {
+ ::tk::startOfNextWord "ab cd" 0
+} -result 3
+test cluster-5.2 {::tk::startOfNextWord} -body {
+ ::tk::startOfNextWord "ab cd" 1
+} -result 3
+test cluster-5.3 {::tk::startOfNextWord} -body {
+ ::tk::startOfNextWord "ab cd" 2
+} -result 3
+test cluster-5.4 {::tk::startOfNextWord} -body {
+ ::tk::startOfNextWord "ab cd" 3
+} -result {}
+test cluster-5.5 {::tk::startOfNextWord} -body {
+ ::tk::startOfNextWord "ab cd" 4
+} -result {}
+test cluster-5.6 {::tk::startOfNextWord} -body {
+ ::tk::startOfNextWord "ab cd" 5
+} -result {}
+test cluster-5.7 {::tk::startOfNextWord} -body {
+ ::tk::startOfNextWord "ab cd" end
+} -result {}
+test cluster-5.8 {::tk::startOfNextWord} -body {
+ ::tk::startOfNextWord "ab cd" {}
+} -result 3
+test cluster-5.9 {::tk::startOfNextWord} -body {
+ ::tk::startOfNextWord "ab cd" end-1
+} -result {}
+
+test cluster-6.0 {::tk::wordBreakBefore} -body {
+ ::tk::wordBreakBefore "ab cd" -1
+} -result {}
+test cluster-6.1 {::tk::wordBreakBefore} -body {
+ ::tk::wordBreakBefore "ab cd" 0
+} -result {}
+test cluster-6.2 {::tk::wordBreakBefore} -body {
+ ::tk::wordBreakBefore "ab cd" 1
+} -result {}
+test cluster-6.3 {::tk::wordBreakBefore} -body {
+ ::tk::wordBreakBefore "ab cd" 2
+} -result 2
+test cluster-6.4 {::tk::wordBreakBefore} -body {
+ ::tk::wordBreakBefore "ab cd" 3
+} -result 3
+test cluster-6.5 {::tk::wordBreakBefore} -body {
+ ::tk::wordBreakBefore "ab cd" 4
+} -result 3
+test cluster-6.6 {::tk::wordBreakBefore} -body {
+ ::tk::wordBreakBefore "ab cd" 5
+} -result 3
+test cluster-6.7 {::tk::wordBreakBefore} -body {
+ ::tk::wordBreakBefore "ab cd" end
+} -result 3
+test cluster-6.8 {::tk::wordBreakBefore} -body {
+ ::tk::wordBreakBefore "ab cd" {}
+} -result {}
+test cluster-6.9 {::tk::wordBreakBefore} -body {
+ ::tk::startOfNextWord "ab cd" end-1
+} -result {}
+
+test cluster-7.0 {::tk::wordBreakAfter} -body {
+ ::tk::wordBreakAfter "ab cd" -1
+} -result 2
+test cluster-7.1 {::tk::wordBreakAfter} -body {
+ ::tk::wordBreakAfter "ab cd" 0
+} -result 2
+test cluster-7.2 {::tk::wordBreakAfter} -body {
+ ::tk::wordBreakAfter "ab cd" 1
+} -result 2
+test cluster-7.3 {::tk::wordBreakAfter} -body {
+ ::tk::wordBreakAfter "ab cd" 2
+} -result 3
+test cluster-7.4 {::tk::wordBreakAfter} -body {
+ ::tk::wordBreakAfter "ab cd" 3
+} -result {}
+test cluster-7.5 {::tk::wordBreakAfter} -body {
+ ::tk::wordBreakAfter "ab cd" 4
+} -result {}
+test cluster-7.6 {::tk::wordBreakAfter} -body {
+ ::tk::wordBreakAfter "ab cd" 5
+} -result {}
+test cluster-7.7 {::tk::wordBreakAfter} -body {
+ ::tk::wordBreakAfter "ab cd" end
+} -result {}
+test cluster-7.8 {::tk::wordBreakAfter} -body {
+ ::tk::wordBreakAfter "ab cd" {}
+} -result 2
+test cluster-7.9 {::tk::wordBreakAfter} -body {
+ ::tk::wordBreakAfter "ab cd" end-1
+} -result {}
+
+
+test cluster-8.0 {::tk::startOfCluster} -body {
+ ::tk::startOfCluster a b c d
+} -returnCodes 1 -result {wrong # args: should be "::tk::startOfCluster str start ?locale?"}
+test cluster-8.1 {::tk::endOfCluster} -body {
+ ::tk::endOfCluster a b c d
+} -returnCodes 1 -result {wrong # args: should be "::tk::endOfCluster str start ?locale?"}
+test cluster-8.2 {::tk::startOfPreviousWord} -body {
+ ::tk::startOfPreviousWord a b c d
+} -returnCodes 1 -result {wrong # args: should be "::tk::startOfPreviousWord str start ?locale?"}
+test cluster-8.3 {::tk::startOfNextWord} -body {
+ ::tk::startOfNextWord a b c d
+} -returnCodes 1 -result {wrong # args: should be "::tk::startOfNextWord str start ?locale?"}
+test cluster-8.4 {::tk::endOfWord} -body {
+ ::tk::endOfWord a b c d
+} -returnCodes 1 -result {wrong # args: should be "::tk::endOfWord str start ?locale?"}
+test cluster-8.5 {::tk::wordBreakBefore} -body {
+ ::tk::wordBreakBefore a b c d
+} -returnCodes 1 -result {wrong # args: should be "::tk::wordBreakBefore str start ?locale?"}
+test cluster-8.6 {::tk::wordBreakAfter} -body {
+ ::tk::wordBreakAfter a b c d
+} -returnCodes 1 -result {wrong # args: should be "::tk::wordBreakAfter str start ?locale?"}
+
+cleanupTests
+return