aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2010-01-24 12:50:39 +1000
committerSteve Bennett <steveb@workware.net.au>2010-10-15 11:02:44 +1000
commitb33cf7f87ff295726c4a9e86b74217bcb64dbf78 (patch)
tree3efb922f49b52b38112b7803319be6812e180635 /tests
parenta230afdc68bcad14a9dfd0f9c8c6955980669cd6 (diff)
downloadjimtcl-b33cf7f87ff295726c4a9e86b74217bcb64dbf78.zip
jimtcl-b33cf7f87ff295726c4a9e86b74217bcb64dbf78.tar.gz
jimtcl-b33cf7f87ff295726c4a9e86b74217bcb64dbf78.tar.bz2
Rework script/subst parser for improved performance
*: Keep abc(def) as a single token, but split abc($def) into 4 tokens *: Then optimise when interpolating to keep a reference to the underlying objects *: This speeds up the 'set a($b)' case a lot *: Also avoid so much alloc/realloc when parsing scripts and subst objects Also simplify cmdStruct creation *: Can omit args=-1 for expand *: Makes it easy to calculate the length *: Do it all in a single loop for simplicity, size and speed
Diffstat (limited to 'tests')
-rw-r--r--tests/array.test7
-rw-r--r--tests/misc.test36
2 files changed, 21 insertions, 22 deletions
diff --git a/tests/array.test b/tests/array.test
index a5aada5..de9283c 100644
--- a/tests/array.test
+++ b/tests/array.test
@@ -66,10 +66,9 @@ test array-1.11 "array unset - all" {
} {0 0}
test array-1.12 "array set to invalid variable" {
- unset -nocomplain a b
- set a 1
- catch {array set a(1) {b c}}
+ unset -nocomplain a b
+ set a 1
+ catch {array set a(1) {b c}}
} {1}
-
testreport
diff --git a/tests/misc.test b/tests/misc.test
index 53c37eb..7f70bc3 100644
--- a/tests/misc.test
+++ b/tests/misc.test
@@ -129,76 +129,76 @@ test lindex-1.1 "Integer" {
lindex {a b c} 0
} a
-test lindex-1.1 "Integer" {
+test lindex-1.2 "Integer" {
lindex {a b c} 2
} c
-test lindex-1.1 "Integer" {
+test lindex-1.3 "Integer" {
lindex {a b c} -1
} {}
-test lindex-1.1 "Integer" {
+test lindex-1.4 "Integer" {
lindex {a b c} 4
} {}
-test lindex-1.1 "end" {
+test lindex-1.5 "end" {
lindex {a b c} end
} c
-test lindex-1.1 "end" {
+test lindex-1.6 "end" {
lindex {a b c} end-1
} b
-test lindex-1.1 "end" {
+test lindex-1.7 "end" {
lindex {a b c} end-4
} {}
-test lindex-1.1 "end - errors" {
+test lindex-1.8 "end - errors" {
catch {lindex {a b c} end-}
} 1
-test lindex-1.1 "end - errors" {
+test lindex-1.9 "end - errors" {
catch {lindex {a b c} end-blah}
} 1
-test lindex-1.1 "end - errors" {
+test lindex-1.10 "end - errors" {
catch {lindex {a b c} end+1}
} 1
-test lindex-1.1 "int+int, int-int" {
+test lindex-1.11 "int+int, int-int" {
lindex {a b c} 0+1
} b
-test lindex-1.1 "int+int, int-int" {
+test lindex-1.12 "int+int, int-int" {
lindex {a b c} 0+4
} {}
-test lindex-1.1 "int+int, int-int" {
+test lindex-1.13 "int+int, int-int" {
lindex {a b c} 3-1
} c
-test lindex-1.1 "int+int, int-int" {
+test lindex-1.14 "int+int, int-int" {
lindex {a b c} 1--1
} c
-test lindex-1.1 "int+int, int-int" {
+test lindex-1.15 "int+int, int-int" {
set l {a b c}
lindex $l [lsearch $l b]-1
} a
-test lindex-1.1 "int+int - errors" {
+test lindex-1.16 "int+int - errors" {
catch {lindex {a b c} 5+blah}
} 1
-test lindex-1.1 "int+int - errors" {
+test lindex-1.17 "int+int - errors" {
catch {lindex {a b c} 5-blah}
} 1
-test lindex-1.1 "int+int - errors" {
+test lindex-1.18 "int+int - errors" {
catch {lindex {a b c} blah-2}
} 1
-test lindex-1.1 "unary plus" {
+test lindex-1.19 "unary plus" {
lindex {a b c} +2
} c