summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/tk.test52
1 files changed, 36 insertions, 16 deletions
diff --git a/tests/tk.test b/tests/tk.test
index c62832c..bfd0cf8 100644
--- a/tests/tk.test
+++ b/tests/tk.test
@@ -5,7 +5,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: tk.test,v 1.3 1999/04/16 01:51:41 stanton Exp $
+# RCS: @(#) $Id: tk.test,v 1.4 1999/12/16 21:58:29 hobbs Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
source [file join [pwd] [file dirname [info script]] defs.tcl]
@@ -16,7 +16,7 @@ test tk-1.1 {tk command: general} {
} {1 {wrong # args: should be "tk option ?arg?"}}
test tk-1.2 {tk command: general} {
list [catch {tk xyz} msg] $msg
-} {1 {bad option "xyz": must be appname or scaling}}
+} {1 {bad option "xyz": must be appname, scaling, or useinputmethods}}
set appname [tk appname]
test tk-2.1 {tk command: appname} {
@@ -33,7 +33,7 @@ test tk-2.4 {tk command: appname} {
tk appname $appname
} $appname
tk appname $appname
-
+
set scaling [tk scaling]
test tk-3.1 {tk command: scaling} {
list [catch {tk scaling -displayof} msg] $msg
@@ -78,19 +78,39 @@ test tk-3.11 {tk command: scaling: heightmm} {
} {0}
tk scaling $scaling
+set useim [tk useinputmethods]
+test tk-4.1 {tk command: useinputmethods} {
+ list [catch {tk useinputmethods -displayof} msg] $msg
+} {1 {value for "-displayof" missing}}
+test tk-4.2 {tk command: useinputmethods: get current} {
+ tk useinputmethods no
+} 0
+test tk-4.3 {tk command: useinputmethods: get current} {
+ tk useinputmethods -displayof .
+} 0
+test tk-4.4 {tk command: useinputmethods: set new} {
+ list [catch {tk useinputmethods xyz} msg] $msg
+} {1 {expected boolean value but got "xyz"}}
+test tk-4.5 {tk command: useinputmethods: set new} {
+ list [catch {tk useinputmethods -displayof . xyz} msg] $msg
+} {1 {expected boolean value but got "xyz"}}
+test tk-4.6 {tk command: useinputmethods: set new} {unixOnly} {
+ # This isn't really a test, but more of a check...
+ # The answer is what was given, because we may be on a Unix
+ # system that doesn't have the XIM stuff
+ if {[tk useinputmethods 1] == 0} {
+ puts "this wish doesn't have XIM (X Input Methods) support"
+ }
+ # We should always start with XIM support off
+ set useim
+} 0
+test tk-4.7 {tk command: useinputmethods: set new} {macOrPc} {
+ # Mac and Windows don't have X Input Methods, so this should
+ # always return 0
+ tk useinputmethods 1
+} 0
+tk useinputmethods $useim
+
# cleanup
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
-