diff options
author | fvogel <fvogelnew1@free.fr> | 2024-06-09 12:29:09 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2024-06-09 12:29:09 (GMT) |
commit | 349a69f9287ebf1e15f32de11cca27f67713ade7 (patch) | |
tree | 22941bb5b94f32b0712106c738691f4c54015336 /tests/menu.test | |
parent | 620f58a044a9b25a3b58df35d4eb16cbfb05b7ff (diff) | |
download | tk-349a69f9287ebf1e15f32de11cca27f67713ade7.zip tk-349a69f9287ebf1e15f32de11cca27f67713ade7.tar.gz tk-349a69f9287ebf1e15f32de11cca27f67713ade7.tar.bz2 |
Remove constraints hasEarthPhoto and hasOusterPhoto, the image files used in the tests are distributed in the tests directory so these constraints are always satisfied.
Diffstat (limited to 'tests/menu.test')
-rw-r--r-- | tests/menu.test | 68 |
1 files changed, 21 insertions, 47 deletions
diff --git a/tests/menu.test b/tests/menu.test index 8b3b556..b345e26 100644 --- a/tests/menu.test +++ b/tests/menu.test @@ -287,9 +287,8 @@ menu .m2 -tearoff 1 .m1 add checkbutton -label "checkbutton" -variable check -onvalue on -offvalue off .m1 add radiobutton -label "radiobutton" -variable radio -if {[testConstraint hasEarthPhoto]} { - image create photo image1 -file $earthPhotoFile -} +set earthPhotoFile [file join [file dirname [info script]] earth.gif] +image create photo image1 -file $earthPhotoFile test menu-2.31 {entry configuration options 0 -activebackground #012345 tearoff} -body { .m1 entryconfigure 0 -activebackground #012345 @@ -689,15 +688,11 @@ test menu-2.120 {entry configuration options 5 -foreground non-existent radiobut .m1 entryconfigure 5 -foreground non-existent } -returnCodes error -result {unknown color name "non-existent"} -test menu-2.121 {entry configuration options 0 -image image1 tearoff} -constraints { - hasEarthPhoto -} -body { +test menu-2.121 {entry configuration options 0 -image image1 tearoff} -body { .m1 entryconfigure 0 -image image1 } -returnCodes error -result {unknown option "-image"} -test menu-2.122 {entry configuration options 1 -image image1 command} -constraints { - hasEarthPhoto -} -setup { +test menu-2.122 {entry configuration options 1 -image image1 command} -setup { .m1 entryconfigure 1 -image {} } -body { .m1 entryconfigure 1 -image image1 @@ -706,9 +701,7 @@ test menu-2.122 {entry configuration options 1 -image image1 command} -constrain .m1 entryconfigure 1 -image {} } -result {image1} -test menu-2.123 {entry configuration options 2 -image image1 cascade} -constraints { - hasEarthPhoto -} -setup { +test menu-2.123 {entry configuration options 2 -image image1 cascade} -setup { .m1 entryconfigure 2 -image {} } -body { .m1 entryconfigure 2 -image image1 @@ -717,15 +710,11 @@ test menu-2.123 {entry configuration options 2 -image image1 cascade} -constrain .m1 entryconfigure 2 -image {} } -result {image1} -test menu-2.124 {entry configuration options 3 -image image1 separator} -constraints { - hasEarthPhoto -} -body { +test menu-2.124 {entry configuration options 3 -image image1 separator} -body { .m1 entryconfigure 3 -image image1 } -returnCodes error -result {unknown option "-image"} -test menu-2.125 {entry configuration options 4 -image image1 checkbutton} -constraints { - hasEarthPhoto -} -setup { +test menu-2.125 {entry configuration options 4 -image image1 checkbutton} -setup { .m1 entryconfigure 4 -image {} } -body { .m1 entryconfigure 4 -image image1 @@ -734,9 +723,7 @@ test menu-2.125 {entry configuration options 4 -image image1 checkbutton} -const .m1 entryconfigure 4 -image {} } -result {image1} -test menu-2.126 {entry configuration options 5 -image image1 radiobutton} -constraints { - hasEarthPhoto -} -setup { +test menu-2.126 {entry configuration options 5 -image image1 radiobutton} -setup { .m1 entryconfigure 5 -image {} } -body { .m1 entryconfigure 5 -image image1 @@ -980,33 +967,23 @@ test menu-2.180 {entry configuration options 5 -selectcolor non-existent radiobu .m1 entryconfigure 5 -selectcolor non-existent } -returnCodes error -result {unknown color name "non-existent"} -test menu-2.181 {entry configuration options 0 -selectimage image1 tearoff} -constraints { - hasEarthPhoto -} -body { +test menu-2.181 {entry configuration options 0 -selectimage image1 tearoff} -body { .m1 entryconfigure 0 -selectimage image1 } -returnCodes error -result {unknown option "-selectimage"} -test menu-2.182 {entry configuration options 1 -selectimage image1 command} -constraints { - hasEarthPhoto -} -body { +test menu-2.182 {entry configuration options 1 -selectimage image1 command} -body { .m1 entryconfigure 1 -selectimage image1 } -returnCodes error -result {unknown option "-selectimage"} -test menu-2.183 {entry configuration options 2 -selectimage image1 cascade} -constraints { - hasEarthPhoto -} -body { +test menu-2.183 {entry configuration options 2 -selectimage image1 cascade} -body { .m1 entryconfigure 2 -selectimage image1 } -returnCodes error -result {unknown option "-selectimage"} -test menu-2.184 {entry configuration options 3 -selectimage image1 separator} -constraints { - hasEarthPhoto -} -body { +test menu-2.184 {entry configuration options 3 -selectimage image1 separator} -body { .m1 entryconfigure 3 -selectimage image1 } -returnCodes error -result {unknown option "-selectimage"} -test menu-2.185 {entry configuration options 4 -selectimage image1 checkbutton} -constraints { - hasEarthPhoto -} -setup { +test menu-2.185 {entry configuration options 4 -selectimage image1 checkbutton} -setup { .m1 entryconfigure 4 -selectimage {} } -body { .m1 entryconfigure 4 -selectimage image1 @@ -1015,9 +992,7 @@ test menu-2.185 {entry configuration options 4 -selectimage image1 checkbutton} .m1 entryconfigure 4 -selectimage {} } -result {image1} -test menu-2.186 {entry configuration options 5 -selectimage image1 radiobutton} -constraints { - hasEarthPhoto -} -setup { +test menu-2.186 {entry configuration options 5 -selectimage image1 radiobutton} -setup { .m1 entryconfigure 5 -selectimage {} } -body { .m1 entryconfigure 5 -selectimage image1 @@ -1209,10 +1184,7 @@ test menu-2.228 {entry configuration options 5 -underline 3p radiobutton} -body } -returnCodes error -result {expected integer but got "3p"} deleteWindows -if {[testConstraint hasEarthPhoto]} { - image delete image1 -} - +image delete image1 test menu-3.1 {MenuWidgetCmd procedure} -setup { @@ -2328,7 +2300,7 @@ test menu-8.1 {DestroyMenuEntry} -setup { .m1 add cascade -menu .m2 list [.m1 delete 1] [destroy .m1 .m2] } -result {{} {}} -test menu-8.2 {DestroyMenuEntry} -constraints hasEarthPhoto -setup { +test menu-8.2 {DestroyMenuEntry} -setup { deleteWindows catch {image delete image1a} } -body { @@ -2669,7 +2641,7 @@ test menu-11.18 {ConfigureMenuEntry} -constraints testImageType -setup { imageCleanup } -result {} test menu-11.19 {ConfigureMenuEntry} -constraints { - testImageType hasEarthPhoto + testImageType } -setup { deleteWindows imageCleanup @@ -2684,7 +2656,7 @@ test menu-11.19 {ConfigureMenuEntry} -constraints { imageCleanup } -result {} test menu-11.20 {ConfigureMenuEntry} -constraints { - testImageType hasEarthPhoto + testImageType } -setup { deleteWindows imageCleanup @@ -2699,7 +2671,7 @@ test menu-11.20 {ConfigureMenuEntry} -constraints { imageCleanup } -result {} test menu-11.21 {ConfigureMenuEntry} -constraints { - testImageType hasEarthPhoto + testImageType } -setup { deleteWindows imageCleanup @@ -2715,6 +2687,8 @@ test menu-11.21 {ConfigureMenuEntry} -constraints { imageCleanup } -result {} +unset earthPhotoFile + test menu-12.1 {ConfigureMenuCloneEntries} -setup { deleteWindows |