summaryrefslogtreecommitdiffstats
path: root/tests/embed.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/embed.test')
-rw-r--r--tests/embed.test35
1 files changed, 28 insertions, 7 deletions
diff --git a/tests/embed.test b/tests/embed.test
index d3c0753..bac2675 100644
--- a/tests/embed.test
+++ b/tests/embed.test
@@ -5,12 +5,11 @@
# All rights reserved.
package require tcltest 2.1
-namespace import -force tcltest::configure
-namespace import -force tcltest::testsDirectory
-configure -testdir [file join [pwd] [file dirname [info script]]]
-configure -loadfile [file join [testsDirectory] constraints.tcl]
+eval tcltest::configure $argv
tcltest::loadTestedCommands
+global tcl_platform
+
test embed-1.1 {TkpUseWindow procedure, bad window identifier} {
deleteWindows
list [catch {toplevel .t -use xyz} msg] $msg
@@ -29,21 +28,43 @@ test embed-1.3 {CreateFrame procedure, both -use and
-container 1} msg] $msg
} {1 {A window cannot have both the -use and the -container option set.}}
-test embed-1.4 {TkpUseWindow procedure, -container must be set} {
+if {$tcl_platform(platform) == "windows"} {
+
+# testing window embedding for Windows platform
+
+test embed-1.4.win {TkpUseWindow procedure, -container must be set} {
+ deleteWindows
+ toplevel .container
+ list [catch {toplevel .embd -use [winfo id .container]} err] $err
+} {1 {the window to use is not a Tk container}}
+
+test embed-1.5.win {TkpUseWindow procedure, -container must be set} {
+ deleteWindows
+ frame .container
+ list [catch {toplevel .embd -use [winfo id .container]} err] $err
+} {1 {the window to use is not a Tk container}}
+
+} else {
+
+# testing window embedding for other platforms
+
+test embed-1.4.nonwin {TkpUseWindow procedure, -container must be set} {
deleteWindows
toplevel .container
list [catch {toplevel .embd -use [winfo id .container]} err] $err
} {1 {window ".container" doesn't have -container option set}}
-test embed-1.5 {TkpUseWindow procedure, -container must be set} {
+test embed-1.5.nonwin {TkpUseWindow procedure, -container must be set} {
deleteWindows
frame .container
list [catch {toplevel .embd -use [winfo id .container]} err] $err
} {1 {window ".container" doesn't have -container option set}}
+}
# FIXME: test cases common to unixEmbed.test and macEmbed.test should
# be moved here.
-tcltest::cleanupTests
+cleanupTests
return
+