summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandy <andrew.m.goth@gmail.com>2016-12-11 05:00:40 (GMT)
committerandy <andrew.m.goth@gmail.com>2016-12-11 05:00:40 (GMT)
commit71abe8071e531e0d9bcca88412975cafe293953c (patch)
tree03731b9bf602adbf782174badf584c09399dd419
parente4a1d54c4d7b2982d6389a43a6ae4d8f8e5be91e (diff)
downloadtcl-71abe8071e531e0d9bcca88412975cafe293953c.zip
tcl-71abe8071e531e0d9bcca88412975cafe293953c.tar.gz
tcl-71abe8071e531e0d9bcca88412975cafe293953c.tar.bz2
Finish implementing array search tests
-rw-r--r--tests/array.test15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/array.test b/tests/array.test
index e1e75f1..cfe0d77 100644
--- a/tests/array.test
+++ b/tests/array.test
@@ -777,13 +777,13 @@ foreach {
desc
name dict args result
} {
- "empty array"
+ "no filter, empty array"
array-7.2 {} {} {}
- "single element"
+ "no filter, single element"
array-7.3 {e 1} {} {e}
- "two elements"
+ "no filter, two elements"
array-7.4 {f 2 e 1} {} {e f}
"default filter, matches nothing"
@@ -809,6 +809,15 @@ foreach {
"-exact filter, matches one item"
array-7.12 {f 2 e 1} {-exact f} {f}
+
+ "-regexp filter, matches nothing"
+ array-7.13 {f 2 e 1} {-regexp ^[g]} {}
+
+ "-regexp filter, matches one item"
+ array-7.14 {f 2 e 1} {-regexp ^[f]} {f}
+
+ "-regexp filter, matches two items"
+ array-7.15 {f 2 e 1} {-regexp ^[ef]} {e f}
} {
test {
name $name