summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2020-03-11 15:55:31 (GMT)
committersebres <sebres@users.sourceforge.net>2020-03-11 15:55:31 (GMT)
commit2ded4dcac55bd18c10ff2815a4dc742bf18f70a0 (patch)
treed8d3e98697fd17db821fa04eba7064d78347227c /tests
parent72f5a0b42fd69b0ccad811c45ab2d2b265a67b63 (diff)
parente13a8e77f200f5c1d8c71b0db7f5dba3f10eda4d (diff)
downloadtcl-2ded4dcac55bd18c10ff2815a4dc742bf18f70a0.zip
tcl-2ded4dcac55bd18c10ff2815a4dc742bf18f70a0.tar.gz
tcl-2ded4dcac55bd18c10ff2815a4dc742bf18f70a0.tar.bz2
merge 8.7 (lpop SF fix)
Diffstat (limited to 'tests')
-rw-r--r--tests/lpop.test33
1 files changed, 19 insertions, 14 deletions
diff --git a/tests/lpop.test b/tests/lpop.test
index 89b651c..3e28978 100644
--- a/tests/lpop.test
+++ b/tests/lpop.test
@@ -16,6 +16,7 @@ if {[lsearch [namespace children] ::tcltest] == -1} {
namespace import -force ::tcltest::*
}
+unset -nocomplain no; # following tests expecting var "no" does not exists
test lpop-1.1 {error conditions} -returnCodes error -body {
lpop no
} -result {can't read "no": no such variable}
@@ -23,32 +24,36 @@ test lpop-1.2 {error conditions} -returnCodes error -body {
lpop no 0
} -result {can't read "no": no such variable}
test lpop-1.3 {error conditions} -returnCodes error -body {
- set no "x {}x"
- lpop no
+ set l "x {}x"
+ lpop l
} -result {list element in braces followed by "x" instead of space}
test lpop-1.4 {error conditions} -returnCodes error -body {
- set no "x y"
- lpop no -1
+ set l "x y"
+ lpop l -1
} -result {index "-1" out of range}
+test lpop-1.4b {error conditions (also check SF on empty list variable, bug [234d6c811d])} -body {
+ set l "x y"
+ list [lpop l] [lpop l] [catch {lpop l} v] $v [catch {lpop l 0} v] $v $l
+} -result {y x 1 {index "end" out of range} 1 {index "0" out of range} {}}
test lpop-1.5 {error conditions} -returnCodes error -body {
- set no "x y z"
- lpop no 3
+ set l "x y z"
+ lpop l 3
} -result {index "3" out of range} ;#-errorCode {TCL OPERATION LPOP BADINDEX}
test lpop-1.6 {error conditions} -returnCodes error -body {
- set no "x y"
- lpop no end+1
+ set l "x y"
+ lpop l end+1
} -result {index "end+1" out of range}
test lpop-1.7 {error conditions} -returnCodes error -body {
- set no "x y"
- lpop no {}
+ set l "x y"
+ lpop l {}
} -match glob -result {bad index *}
test lpop-1.8 {error conditions} -returnCodes error -body {
- set no "x y"
- lpop no 0 0 0 0 1
+ set l "x y"
+ lpop l 0 0 0 0 1
} -result {index "1" out of range}
test lpop-1.9 {error conditions} -returnCodes error -body {
- set no "x y"
- lpop no {1 0}
+ set l "x y"
+ lpop l {1 0}
} -match glob -result {bad index *}
test lpop-2.1 {basic functionality} -body {