summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2020-01-01 16:46:55 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2020-01-01 16:46:55 (GMT)
commit8249e877dffdca52ba20e0ffebdc9c7bd37c30ae (patch)
tree55925828ba3151b4deed527642db917d38755074 /tests
parentb308bd97e6cdee90b11f3409a485253c414bbac0 (diff)
downloadtcl-8249e877dffdca52ba20e0ffebdc9c7bd37c30ae.zip
tcl-8249e877dffdca52ba20e0ffebdc9c7bd37c30ae.tar.gz
tcl-8249e877dffdca52ba20e0ffebdc9c7bd37c30ae.tar.bz2
More error cases
Diffstat (limited to 'tests')
-rw-r--r--tests/oo.test76
1 files changed, 53 insertions, 23 deletions
diff --git a/tests/oo.test b/tests/oo.test
index 673b941..4d28794 100644
--- a/tests/oo.test
+++ b/tests/oo.test
@@ -5850,7 +5850,7 @@ test oo-46.3 {TIP 558: properties: declaration semantics} -setup {
}
} -returnCodes error -cleanup {
parent destroy
-} -result {bad property name "-x"; must not begin with -}
+} -result {bad property name "-x": must not begin with -}
test oo-46.4 {TIP 558: properties: declaration semantics} -setup {
oo::class create parent
} -body {
@@ -5860,18 +5860,48 @@ test oo-46.4 {TIP 558: properties: declaration semantics} -setup {
}
} -returnCodes error -cleanup {
parent destroy
-} -result {bad property name "x y"; must be a simple word}
+} -result {bad property name "x y": must be a simple word}
test oo-46.5 {TIP 558: properties: declaration semantics} -setup {
oo::class create parent
} -body {
oo::configurable create Point {superclass parent}
oo::define Point {
+ property ::x
+ }
+} -returnCodes error -cleanup {
+ parent destroy
+} -result {bad property name "::x": must not contain namespace separators}
+test oo-46.6 {TIP 558: properties: declaration semantics} -setup {
+ oo::class create parent
+} -body {
+ oo::configurable create Point {superclass parent}
+ oo::define Point {
+ property x(
+ }
+} -returnCodes error -cleanup {
+ parent destroy
+} -result {bad property name "x(": must not contain parentheses}
+test oo-46.7 {TIP 558: properties: declaration semantics} -setup {
+ oo::class create parent
+} -body {
+ oo::configurable create Point {superclass parent}
+ oo::define Point {
+ property x)
+ }
+} -returnCodes error -cleanup {
+ parent destroy
+} -result {bad property name "x)": must not contain parentheses}
+test oo-46.8 {TIP 558: properties: declaration semantics} -setup {
+ oo::class create parent
+} -body {
+ oo::configurable create Point {superclass parent}
+ oo::define Point {
property x -get
}
} -returnCodes error -cleanup {
parent destroy
} -result {missing body to go with -get option}
-test oo-46.6 {TIP 558: properties: declaration semantics} -setup {
+test oo-46.9 {TIP 558: properties: declaration semantics} -setup {
oo::class create parent
} -body {
oo::configurable create Point {superclass parent}
@@ -5881,7 +5911,7 @@ test oo-46.6 {TIP 558: properties: declaration semantics} -setup {
} -returnCodes error -cleanup {
parent destroy
} -result {missing body to go with -set option}
-test oo-46.7 {TIP 558: properties: declaration semantics} -setup {
+test oo-46.10 {TIP 558: properties: declaration semantics} -setup {
oo::class create parent
} -body {
oo::configurable create Point {superclass parent}
@@ -5891,7 +5921,7 @@ test oo-46.7 {TIP 558: properties: declaration semantics} -setup {
} -returnCodes error -cleanup {
parent destroy
} -result {missing kind value to go with -kind option}
-test oo-46.8 {TIP 558: properties: declaration semantics} -setup {
+test oo-46.11 {TIP 558: properties: declaration semantics} -setup {
oo::class create parent
} -body {
oo::configurable create Point {superclass parent}
@@ -5901,7 +5931,7 @@ test oo-46.8 {TIP 558: properties: declaration semantics} -setup {
} -returnCodes error -cleanup {
parent destroy
} -result {missing body to go with -set option}
-test oo-46.9 {TIP 558: properties: declaration semantics} -setup {
+test oo-46.12 {TIP 558: properties: declaration semantics} -setup {
oo::class create parent
} -body {
oo::configurable create Point {
@@ -5912,7 +5942,7 @@ test oo-46.9 {TIP 558: properties: declaration semantics} -setup {
} -cleanup {
parent destroy
} -result ok
-test oo-46.10 {TIP 558: properties: declaration semantics} -setup {
+test oo-46.13 {TIP 558: properties: declaration semantics} -setup {
oo::class create parent
} -body {
oo::configurable create Point {
@@ -5922,7 +5952,7 @@ test oo-46.10 {TIP 558: properties: declaration semantics} -setup {
} -returnCodes error -cleanup {
parent destroy
} -result {bad kind "gorp": must be readable, readwrite, or writable}
-test oo-46.11 {TIP 558: properties: declaration semantics} -setup {
+test oo-46.14 {TIP 558: properties: declaration semantics} -setup {
oo::class create parent
} -body {
oo::configurable create Point {
@@ -5933,7 +5963,7 @@ test oo-46.11 {TIP 558: properties: declaration semantics} -setup {
} -cleanup {
parent destroy
} -result ok
-test oo-46.12 {TIP 558: properties: declaration semantics} -setup {
+test oo-46.15 {TIP 558: properties: declaration semantics} -setup {
oo::class create parent
} -body {
oo::configurable create Point {
@@ -5947,7 +5977,7 @@ test oo-46.12 {TIP 558: properties: declaration semantics} -setup {
} -cleanup {
parent destroy
} -result ok
-test oo-46.13 {TIP 558: properties: declaration semantics} -setup {
+test oo-46.16 {TIP 558: properties: declaration semantics} -setup {
oo::class create parent
unset -nocomplain msg
} -body {
@@ -5968,7 +5998,7 @@ test oo-46.13 {TIP 558: properties: declaration semantics} -setup {
} -cleanup {
parent destroy
} -result {0 {} 1 {property "-x" is write only} 1 {bad property "-y": must be -x}}
-test oo-46.14 {TIP 558: properties: declaration semantics} -setup {
+test oo-46.17 {TIP 558: properties: declaration semantics} -setup {
oo::class create parent
} -body {
oo::configurable create Point {
@@ -5982,7 +6012,7 @@ test oo-46.14 {TIP 558: properties: declaration semantics} -setup {
} -returnCodes error -cleanup {
parent destroy
} -result {property getter for -x did a break}
-test oo-46.15 {TIP 558: properties: declaration semantics} -setup {
+test oo-46.18 {TIP 558: properties: declaration semantics} -setup {
oo::class create parent
} -body {
oo::configurable create Point {
@@ -5996,7 +6026,7 @@ test oo-46.15 {TIP 558: properties: declaration semantics} -setup {
} -returnCodes error -cleanup {
parent destroy
} -result {property getter for -x did a break}
-test oo-46.16 {TIP 558: properties: declaration semantics} -setup {
+test oo-46.19 {TIP 558: properties: declaration semantics} -setup {
oo::class create parent
} -body {
oo::configurable create Point {
@@ -6010,7 +6040,7 @@ test oo-46.16 {TIP 558: properties: declaration semantics} -setup {
} -returnCodes error -cleanup {
parent destroy
} -result boo
-test oo-46.17 {TIP 558: properties: declaration semantics} -setup {
+test oo-46.20 {TIP 558: properties: declaration semantics} -setup {
oo::class create parent
} -body {
oo::configurable create Point {
@@ -6024,7 +6054,7 @@ test oo-46.17 {TIP 558: properties: declaration semantics} -setup {
} -returnCodes error -cleanup {
parent destroy
} -result boo
-test oo-46.18 {TIP 558: properties: declaration semantics} -setup {
+test oo-46.21 {TIP 558: properties: declaration semantics} -setup {
oo::class create parent
} -body {
oo::configurable create Point {
@@ -6038,7 +6068,7 @@ test oo-46.18 {TIP 558: properties: declaration semantics} -setup {
} -returnCodes error -cleanup {
parent destroy
} -result {property getter for -x did a continue}
-test oo-46.19 {TIP 558: properties: declaration semantics} -setup {
+test oo-46.22 {TIP 558: properties: declaration semantics} -setup {
oo::class create parent
} -body {
oo::configurable create Point {
@@ -6052,7 +6082,7 @@ test oo-46.19 {TIP 558: properties: declaration semantics} -setup {
} -cleanup {
parent destroy
} -result ok
-test oo-46.20 {TIP 558: properties: declaration semantics} -setup {
+test oo-46.23 {TIP 558: properties: declaration semantics} -setup {
oo::class create parent
} -body {
oo::configurable create Point {
@@ -6066,7 +6096,7 @@ test oo-46.20 {TIP 558: properties: declaration semantics} -setup {
} -cleanup {
parent destroy
} -result ok
-test oo-46.21 {TIP 558: properties: declaration semantics} -setup {
+test oo-46.24 {TIP 558: properties: declaration semantics} -setup {
oo::class create parent
} -body {
oo::configurable create Point {
@@ -6080,7 +6110,7 @@ test oo-46.21 {TIP 558: properties: declaration semantics} -setup {
} -returnCodes error -cleanup {
parent destroy
} -result {property setter for -x did a break}
-test oo-46.22 {TIP 558: properties: declaration semantics} -setup {
+test oo-46.25 {TIP 558: properties: declaration semantics} -setup {
oo::class create parent
} -body {
oo::configurable create Point {
@@ -6094,7 +6124,7 @@ test oo-46.22 {TIP 558: properties: declaration semantics} -setup {
} -returnCodes error -cleanup {
parent destroy
} -result {property setter for -x did a continue}
-test oo-46.23 {TIP 558: properties: declaration semantics} -setup {
+test oo-46.26 {TIP 558: properties: declaration semantics} -setup {
oo::class create parent
} -body {
oo::configurable create Point {
@@ -6108,7 +6138,7 @@ test oo-46.23 {TIP 558: properties: declaration semantics} -setup {
} -returnCodes error -cleanup {
parent destroy
} -result boo
-test oo-46.24 {TIP 558: properties: declaration semantics} -setup {
+test oo-46.27 {TIP 558: properties: declaration semantics} -setup {
oo::class create parent
} -body {
oo::configurable create Point {
@@ -6122,7 +6152,7 @@ test oo-46.24 {TIP 558: properties: declaration semantics} -setup {
} -cleanup {
parent destroy
} -result ok
-test oo-46.25 {TIP 558: properties: declaration semantics} -setup {
+test oo-46.28 {TIP 558: properties: declaration semantics} -setup {
oo::class create parent
} -body {
oo::configurable create Point {
@@ -6145,7 +6175,7 @@ test oo-47.1 {TIP 558: properties: error details} -setup {
[dict get $opt -errorinfo] [dict get $opt -errorcode]
} -cleanup {
parent destroy
-} -result {1 {bad property name "-x"; must not begin with -
+} -result {1 {bad property name "-x": must not begin with -
while executing
"property -x"
(in definition script for class "::Point" line 1)