summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2018-05-01 12:20:42 (GMT)
committerfvogel <fvogelnew1@free.fr>2018-05-01 12:20:42 (GMT)
commit6e10bc49e4bbf264dadd76df5de6046e0601d127 (patch)
treec79c52e154a6d804c2a00ed17fa176ebc8cbbc11
parent6644cb9c7fa2d34c2feae60aef75445791266a4f (diff)
downloadtk-6e10bc49e4bbf264dadd76df5de6046e0601d127.zip
tk-6e10bc49e4bbf264dadd76df5de6046e0601d127.tar.gz
tk-6e10bc49e4bbf264dadd76df5de6046e0601d127.tar.bz2
Make msgbox.test pass on all platforms (checked on Win Vista, Linux Debian 8 and macOS 10.12.6)
-rw-r--r--library/msgbox.tcl4
-rw-r--r--tests/msgbox.test26
2 files changed, 23 insertions, 7 deletions
diff --git a/library/msgbox.tcl b/library/msgbox.tcl
index d5465ba..6d329c2 100644
--- a/library/msgbox.tcl
+++ b/library/msgbox.tcl
@@ -155,7 +155,7 @@ proc ::tk::MessageBox {args} {
if {$data(-icon) ni {info warning error question}} {
return -code error -errorcode [list TK LOOKUP ICON $data(-icon)] \
- "bad value \"$data(-icon)\": must be error, info, question, or warning"
+ "bad -icon value \"$data(-icon)\": must be error, info, question, or warning"
}
set windowingsystem [tk windowingsystem]
if {$windowingsystem eq "aqua"} {
@@ -207,7 +207,7 @@ proc ::tk::MessageBox {args} {
}
default {
return -code error -errorcode [list TK LOOKUP DLG_TYPE $data(-type)] \
- "bad value \"$data(-type)\": must be\
+ "bad -type value \"$data(-type)\": must be\
abortretryignore, ok, okcancel, retrycancel,\
yesno, or yesnocancel"
}
diff --git a/tests/msgbox.test b/tests/msgbox.test
index e3cefaa..38004f5 100644
--- a/tests/msgbox.test
+++ b/tests/msgbox.test
@@ -50,34 +50,50 @@ test msgbox-1.10 {tk_messageBox command} -body {
tk_messageBox -default
} -returnCodes error -result {value for "-default" missing}
-test msgbox-1.11 {tk_messageBox command} -body {
+test msgbox-1.11.1 {tk_messageBox command} -constraints notAqua -body {
+ tk_messageBox -type foo
+} -returnCodes error -result {bad -type value "foo": must be abortretryignore, ok, okcancel, retrycancel, yesno, or yesnocancel}
+test msgbox-1.11.2 {tk_messageBox command} -constraints aqua -body {
tk_messageBox -type foo
} -returnCodes error -result {bad value "foo": must be abortretryignore, ok, okcancel, retrycancel, yesno, or yesnocancel}
test msgbox-1.12 {tk_messageBox command} -constraints x11 -body {
tk_messageBox -default 1.1
} -returnCodes error -result {invalid default button "1.1"}
-test msgbox-1.13 {tk_messageBox command} -constraints aquaOrWin32 -body {
+test msgbox-1.13 {tk_messageBox command} -constraints aqua -body {
tk_messageBox -default 1.1
} -returnCodes error -result {bad value "1.1": must be abort, retry, ignore, ok, cancel, yes, or no}
+test msgbox-1.13a {tk_messageBox command} -constraints win -body {
+ tk_messageBox -default 1.1
+} -returnCodes error -result {bad -default value "1.1": must be abort, retry, ignore, ok, cancel, no, or yes}
test msgbox-1.14 {tk_messageBox command} -constraints x11 -body {
tk_messageBox -default foo
} -returnCodes error -result {invalid default button "foo"}
-test msgbox-1.15 {tk_messageBox command} -constraints aquaOrWin32 -body {
+test msgbox-1.15 {tk_messageBox command} -constraints aqua -body {
tk_messageBox -default foo
} -returnCodes error -result {bad value "foo": must be abort, retry, ignore, ok, cancel, yes, or no}
+test msgbox-1.15a {tk_messageBox command} -constraints win -body {
+ tk_messageBox -default foo
+} -returnCodes error -result {bad -default value "foo": must be abort, retry, ignore, ok, cancel, no, or yes}
test msgbox-1.16 {tk_messageBox command} -constraints x11 -body {
tk_messageBox -type yesno -default 3
} -returnCodes error -result {invalid default button "3"}
-test msgbox-1.17 {tk_messageBox command} -constraints aquaOrWin32 -body {
+test msgbox-1.17 {tk_messageBox command} -constraints aqua -body {
tk_messageBox -type yesno -default 3
} -returnCodes error -result {bad value "3": must be abort, retry, ignore, ok, cancel, yes, or no}
+test msgbox-1.17a {tk_messageBox command} -constraints win -body {
+ tk_messageBox -type yesno -default 3
+} -returnCodes error -result {bad -default value "3": must be abort, retry, ignore, ok, cancel, no, or yes}
-test msgbox-1.18 {tk_messageBox command} -body {
+test msgbox-1.18 {tk_messageBox command} -constraints notAqua -body {
+ tk_messageBox -icon foo
+} -returnCodes error -result {bad -icon value "foo": must be error, info, question, or warning}
+test msgbox-1.18a {tk_messageBox command} -constraints aqua -body {
tk_messageBox -icon foo
} -returnCodes error -result {bad value "foo": must be error, info, question, or warning}
+
test msgbox-1.19 {tk_messageBox command} -body {
tk_messageBox -parent foo.bar
} -returnCodes error -result {bad window path name "foo.bar"}