diff options
author | fvogel <fvogelnew1@free.fr> | 2024-06-11 03:34:15 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2024-06-11 03:34:15 (GMT) |
commit | c9fe293db7a52a34954db92d2bdc5454d4de3897 (patch) | |
tree | 39c9342e0c9b887fedff449c1ac24969e0352c94 /tests/menu.test | |
parent | 530397e0787965a065721a983cfea4da07446f1b (diff) | |
parent | 15dc2cfa976b10c2dcd29e446a331a7d7f04b790 (diff) | |
download | tk-c9fe293db7a52a34954db92d2bdc5454d4de3897.zip tk-c9fe293db7a52a34954db92d2bdc5454d4de3897.tar.gz tk-c9fe293db7a52a34954db92d2bdc5454d4de3897.tar.bz2 |
Fix [1576528fff]: image read file with -from option. (and resolve merge conflicts)
Diffstat (limited to 'tests/menu.test')
-rw-r--r-- | tests/menu.test | 71 |
1 files changed, 21 insertions, 50 deletions
diff --git a/tests/menu.test b/tests/menu.test index 827f560..72369b5 100644 --- a/tests/menu.test +++ b/tests/menu.test @@ -11,9 +11,6 @@ eval tcltest::configure $argv tcltest::loadTestedCommands imageInit -# find the earth.gif file for use in these tests (tests 2.*) -set earthPhotoFile [file join [file dirname [info script]] earth.gif] -testConstraint hasEarthPhoto [file exists $earthPhotoFile] testConstraint pressbutton [llength [info commands pressbutton]] testConstraint movemouse [llength [info commands movemouse]] @@ -298,9 +295,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 @@ -700,15 +696,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 @@ -717,9 +709,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 @@ -728,15 +718,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 @@ -745,9 +731,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 @@ -991,33 +975,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 @@ -1026,9 +1000,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 @@ -1220,10 +1192,7 @@ test menu-2.228 {entry configuration options 5 -underline 3p radiobutton} -body } -returnCodes error -result {bad index "3p": must be integer?[+-]integer?, end?[+-]integer?, or ""} deleteWindows -if {[testConstraint hasEarthPhoto]} { - image delete image1 -} - +image delete image1 test menu-3.1 {MenuWidgetCmd procedure} -setup { @@ -2347,7 +2316,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 { @@ -2688,7 +2657,7 @@ test menu-11.18 {ConfigureMenuEntry} -constraints testImageType -setup { imageCleanup } -result {} test menu-11.19 {ConfigureMenuEntry} -constraints { - testImageType hasEarthPhoto + testImageType } -setup { deleteWindows imageCleanup @@ -2703,7 +2672,7 @@ test menu-11.19 {ConfigureMenuEntry} -constraints { imageCleanup } -result {} test menu-11.20 {ConfigureMenuEntry} -constraints { - testImageType hasEarthPhoto + testImageType } -setup { deleteWindows imageCleanup @@ -2718,7 +2687,7 @@ test menu-11.20 {ConfigureMenuEntry} -constraints { imageCleanup } -result {} test menu-11.21 {ConfigureMenuEntry} -constraints { - testImageType hasEarthPhoto + testImageType } -setup { deleteWindows imageCleanup @@ -2734,6 +2703,8 @@ test menu-11.21 {ConfigureMenuEntry} -constraints { imageCleanup } -result {} +unset earthPhotoFile + test menu-12.1 {ConfigureMenuCloneEntries} -setup { deleteWindows |