diff options
Diffstat (limited to 'tests/winfo.test')
-rw-r--r-- | tests/winfo.test | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/tests/winfo.test b/tests/winfo.test index 49a92a6..ff3d6b5 100644 --- a/tests/winfo.test +++ b/tests/winfo.test @@ -1,9 +1,9 @@ # This file is a Tcl script to test out the "winfo" command. It is # organized in the standard fashion for Tcl tests. # -# Copyright (c) 1994 The Regents of the University of California. -# Copyright (c) 1994-1997 Sun Microsystems, Inc. -# Copyright (c) 1998-1999 by Scriptics Corporation. +# Copyright © 1994 The Regents of the University of California. +# Copyright © 1994-1997 Sun Microsystems, Inc. +# Copyright © 1998-1999 by Scriptics Corporation. # All rights reserved. package require tcltest 2.2 @@ -11,6 +11,9 @@ namespace import ::tcltest::* tcltest::configure {*}$argv tcltest::loadTestedCommands +testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}] +testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }] + # eatColors -- # Creates a toplevel window and allocates enough colors in it to # use up all the slots in the colormap. @@ -174,7 +177,7 @@ test winfo-4.7 {"winfo containing" command} -setup { expr {($x == ".") || ($x == "")} } -cleanup { destroy .t -} -result {1} +} -result 1 test winfo-5.1 {"winfo interps" command} -body { @@ -188,10 +191,10 @@ test winfo-5.3 {"winfo interps" command} -body { } -returnCodes error -result {bad window path name "geek"} test winfo-5.4 {"winfo interps" command} -constraints unix -body { expr {[lsearch -exact [winfo interps] [tk appname]] >= 0} -} -result {1} +} -result 1 test winfo-5.5 {"winfo interps" command} -constraints unix -body { expr {[lsearch -exact [winfo interps -displayof .] [tk appname]] >= 0} -} -result {1} +} -result 1 test winfo-6.1 {"winfo exists" command} -body { @@ -202,10 +205,10 @@ test winfo-6.2 {"winfo exists" command} -body { } -returnCodes error -result {wrong # args: should be "winfo exists window"} test winfo-6.3 {"winfo exists" command} -body { winfo exists gorp -} -result {0} +} -result 0 test winfo-6.4 {"winfo exists" command} -body { winfo exists . -} -result {1} +} -result 1 test winfo-6.5 {"winfo exists" command} -setup { destroy .b } -body { @@ -290,13 +293,13 @@ test winfo-9.2 {"winfo viewable" command} -body { } -returnCodes error -result {bad window path name "foo"} test winfo-9.3 {"winfo viewable" command} -body { winfo viewable . -} -result {1} -test winfo-9.4 {"winfo viewable" command} -body { +} -result 1 +test winfo-9.4 {"winfo viewable" command} -constraints failsOnUbuntu -body { wm iconify . winfo viewable . } -cleanup { wm deiconify . -} -result {0} +} -result 0 test winfo-9.5 {"winfo viewable" command} -setup { deleteWindows } -body { @@ -320,7 +323,7 @@ test winfo-9.6 {"winfo viewable" command} -setup { } -cleanup { deleteWindows } -result {0 0} -test winfo-9.7 {"winfo viewable" command} -setup { +test winfo-9.7 {"winfo viewable" command} -constraints {failsOnUbuntu failsOnXQuarz} -setup { deleteWindows } -body { frame .f1 -width 100 -height 100 -relief raised -bd 2 @@ -344,7 +347,7 @@ test winfo-10.2 {"winfo visualid" command} -body { } -returnCodes error -result {bad window path name "gorp"} test winfo-10.3 {"winfo visualid" command} -body { expr {2 + [winfo visualid .] - [winfo visualid .]} -} -result {2} +} -result 2 test winfo-11.1 {"winfo visualid" command} -body { @@ -358,14 +361,14 @@ test winfo-11.3 {"winfo visualid" command} -body { } -returnCodes error -result {wrong # args: should be "winfo visualsavailable window ?includeids?"} test winfo-11.4 {"winfo visualid" command} -body { llength [lindex [winfo visualsa .] 0] -} -result {2} +} -result 2 test winfo-11.5 {"winfo visualid" command} -body { llength [lindex [winfo visualsa . includeids] 0] -} -result {3} +} -result 3 test winfo-11.6 {"winfo visualid" command} -body { set x [lindex [lindex [winfo visualsa . includeids] 0] 2] expr {$x + 2 - $x} -} -result {2} +} -result 2 test winfo-12.1 {GetDisplayOf procedure} -body { |