summaryrefslogtreecommitdiffstats
path: root/tests/option.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2002-07-13 20:28:35 (GMT)
committerdgp <dgp@users.sourceforge.net>2002-07-13 20:28:35 (GMT)
commit05961d4dc9e4b65d07feac195998ca0f969b06d9 (patch)
tree83ce372d1ae9d46d27acc5638739bddcbc8e6ba6 /tests/option.test
parent511415799ba6bf2ec3e5d90c57dfbb61da8c6da1 (diff)
downloadtk-05961d4dc9e4b65d07feac195998ca0f969b06d9.zip
tk-05961d4dc9e4b65d07feac195998ca0f969b06d9.tar.gz
tk-05961d4dc9e4b65d07feac195998ca0f969b06d9.tar.bz2
* Converted more files to tcltest and factored out common code.
Diffstat (limited to 'tests/option.test')
-rw-r--r--tests/option.test22
1 files changed, 14 insertions, 8 deletions
diff --git a/tests/option.test b/tests/option.test
index 339d723..173ec37 100644
--- a/tests/option.test
+++ b/tests/option.test
@@ -6,11 +6,17 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: option.test,v 1.3 1999/04/16 01:51:40 stanton Exp $
+# RCS: @(#) $Id: option.test,v 1.4 2002/07/13 20:28:35 dgp Exp $
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+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]
+tcltest::loadTestedCommands
+
+namespace import -force tcltest::makeFile
+namespace import -force tcltest::removeFile
catch {destroy .op1}
catch {destroy .op2}
@@ -185,9 +191,8 @@ test option-14.12 {error conditions} {
list [catch {option get .gorp.gorp a A} msg] $msg
} {1 {bad window path name ".gorp.gorp"}}
-set option1 [file join $::tcltest::testsDir option.file1]
-set option2 [file join $::tcltest::testsDir option.file2]
-set option3 [file join $::tcltest::testsDir option.file3]
+set option1 [file join [testsDirectory] option.file1]
+set option2 [file join [testsDirectory] option.file2]
test option-15.1 {database files} {
list [catch {option read non-existent} msg] $msg
@@ -211,7 +216,8 @@ test option-15.9 {database files} {
} {1 {missing colon on line 2}}
test option-16.1 {ReadOptionFile} {
- set file [open "$option3" w]
+ set option3 [makeFile {} option.file3]
+ set file [open $option3 w]
fconfigure $file -translation crlf
puts $file "*x7: true\n*x8: false"
close $file