summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorhobbs <hobbs@noemail.net>2002-06-17 20:09:01 (GMT)
committerhobbs <hobbs@noemail.net>2002-06-17 20:09:01 (GMT)
commit139b560ef5515c196677ca750084e7540015fcb4 (patch)
tree2526b5918abac20b6e67ff9f285600bd7cf3d3f4 /tests
parent81029bb6e3e88a984b08fa7eebaf04dffb777f1e (diff)
downloadtk-139b560ef5515c196677ca750084e7540015fcb4.zip
tk-139b560ef5515c196677ca750084e7540015fcb4.tar.gz
tk-139b560ef5515c196677ca750084e7540015fcb4.tar.bz2
* generic/tkCmds.c (Tk_TkObjCmd):
* generic/tkInt.h (struct TkCaret): * mac/tkMacXStubs.c (Tk_SetCaretPos): * unix/tkUnixKey.c (TkpGetString, Tk_SetCaretPos): * win/tkWinX.c (Tk_SetCaretPos): * tests/tk.test: Added 'tk caret' implementation of TIP#96 * doc/SetCaret.3 (new): which adds a TkCaret structure element to * doc/tk.n: TkDisplay for maintaining state. FossilOrigin-Name: 6be89a7feefdd57fd30aca27c701f6e155497b67
Diffstat (limited to 'tests')
-rw-r--r--tests/tk.test25
1 files changed, 22 insertions, 3 deletions
diff --git a/tests/tk.test b/tests/tk.test
index a48716a..d9e8baa 100644
--- a/tests/tk.test
+++ b/tests/tk.test
@@ -3,9 +3,9 @@
#
# Copyright (c) 1997 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
-# All rights reserved.
+# Copyright (c) 2002 ActiveState Corporation.
#
-# RCS: @(#) $Id: tk.test,v 1.5 2000/10/31 00:52:11 hobbs Exp $
+# RCS: @(#) $Id: tk.test,v 1.6 2002/06/17 20:09:01 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, scaling, or useinputmethods}}
+} {1 {bad option "xyz": must be appname, caret, scaling, or useinputmethods}}
set appname [tk appname]
test tk-2.1 {tk command: appname} {
@@ -110,6 +110,25 @@ test tk-4.7 {tk command: useinputmethods: set new} {macOrPc} {
} 0
tk useinputmethods $useim
+test tk-5.1 {tk caret} {
+ list [catch {tk caret} msg] $msg
+} {1 {wrong # args: should be "tk caret window ?-x x? ?-y y? ?-height height?"}}
+test tk-5.2 {tk caret} {
+ list [catch {tk caret bogus} msg] $msg
+} {1 {bad window path name "bogus"}}
+test tk-5.3 {tk caret} {
+ list [catch {tk caret . -foo} msg] $msg
+} {1 {bad caret option "-foo": must be -x, -y, or -height}}
+test tk-5.4 {tk caret} {
+ list [catch {tk caret . -x 0 -y} msg] $msg
+} {1 {wrong # args: should be "tk caret window ?-x x? ?-y y? ?-height height?"}}
+test tk-5.5 {tk caret} {
+ list [catch {tk caret . -x 10 -y 11 -h 12; tk caret .} msg] $msg
+} {0 {-height 12 -x 10 -y 11}}
+test tk-5.6 {tk caret} {
+ list [catch {tk caret . -x 20 -y 25 -h 30; tk caret . -hei} msg] $msg
+} {0 30}
+
# cleanup
::tcltest::cleanupTests
return