summaryrefslogtreecommitdiffstats
path: root/tests/assocd.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/assocd.test')
-rw-r--r--tests/assocd.test67
1 files changed, 28 insertions, 39 deletions
diff --git a/tests/assocd.test b/tests/assocd.test
index 7bcf601..46a813a 100644
--- a/tests/assocd.test
+++ b/tests/assocd.test
@@ -11,66 +11,55 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-if {[lsearch [namespace children] ::tcltest] == -1} {
- package require tcltest
- namespace import -force ::tcltest::*
-}
+package require tcltest 2
+namespace import ::tcltest::*
-if {[string compare testsetassocdata [info commands testsetassocdata]] != 0} {
- puts "This application hasn't been compiled with the tests for assocData,"
- puts "therefore I am skipping all of these tests."
- ::tcltest::cleanupTests
- return
-}
+testConstraint testgetassocdata [llength [info commands testgetassocdata]]
+testConstraint testsetassocdata [llength [info commands testsetassocdata]]
+testConstraint testdelassocdata [llength [info commands testdelassocdata]]
-test assocd-1.1 {testing setting assoc data} {
+test assocd-1.1 {testing setting assoc data} testsetassocdata {
testsetassocdata a 1
} ""
-test assocd-1.2 {testing setting assoc data} {
+test assocd-1.2 {testing setting assoc data} testsetassocdata {
testsetassocdata a 2
} ""
-test assocd-1.3 {testing setting assoc data} {
+test assocd-1.3 {testing setting assoc data} testsetassocdata {
testsetassocdata 123 456
} ""
-test assocd-1.4 {testing setting assoc data} {
+test assocd-1.4 {testing setting assoc data} testsetassocdata {
testsetassocdata abc "abc d e f"
} ""
-test assocd-2.1 {testing getting assoc data} {
- testgetassocdata a
-} 2
-test assocd-2.2 {testing getting assoc data} {
- testgetassocdata 123
-} 456
-test assocd-2.3 {testing getting assoc data} {
+test assocd-2.1 {testing getting assoc data} -setup {
+ testsetassocdata a 2
+} -constraints {testgetassocdata} -body {
+ testgetassocdata a
+} -result 2
+test assocd-2.2 {testing getting assoc data} -setup {
+ testsetassocdata 123 456
+} -constraints {testgetassocdata} -body {
+ testgetassocdata 123
+} -result 456
+test assocd-2.3 {testing getting assoc data} -setup {
+ testsetassocdata abc "abc d e f"
+} -constraints {testgetassocdata} -body {
testgetassocdata abc
-} {abc d e f}
-test assocd-2.4 {testing getting assoc data} {
+} -result "abc d e f"
+test assocd-2.4 {testing getting assoc data} testgetassocdata {
testgetassocdata xxx
} ""
-test assocd-3.1 {testing deleting assoc data} {
+test assocd-3.1 {testing deleting assoc data} testdelassocdata {
testdelassocdata a
} ""
-test assocd-3.2 {testing deleting assoc data} {
+test assocd-3.2 {testing deleting assoc data} testdelassocdata {
testdelassocdata 123
} ""
-test assocd-3.3 {testing deleting assoc data} {
+test assocd-3.3 {testing deleting assoc data} testdelassocdata {
list [catch {testdelassocdata nonexistent} msg] $msg
} {0 {}}
# cleanup
-::tcltest::cleanupTests
+cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-