From fe9a0303c60fa1ff636ac866f1cc73f380503d5b Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 3 Jul 2019 23:55:17 -0700 Subject: tests: add @{var1 var2} match test. * tests/001/query-5.txr: New file. * tests/001/query-5.expected: New file. * Makefile (tst/tests/001/query-5.ok): Pass -B to txr for this new test. * tests/017/glob-carray.expected: Updated, because the glob test globs over the contents of tests/001 directory. * tests/017/glob-zarray.expected: Likewise. --- Makefile | 1 + tests/001/query-5.expected | 7 +++++++ tests/001/query-5.txr | 4 ++++ tests/017/glob-carray.expected | 4 ++-- tests/017/glob-zarray.expected | 4 ++-- 5 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 tests/001/query-5.expected create mode 100644 tests/001/query-5.txr diff --git a/Makefile b/Makefile index 81a09551..ae0e2206 100644 --- a/Makefile +++ b/Makefile @@ -370,6 +370,7 @@ tst/tests/001/%: TXR_ARGS := tests/001/data tst/tests/001/query-1.ok: TXR_OPTS := -B tst/tests/001/query-2.ok: TXR_OPTS := -B tst/tests/001/query-4.ok: TXR_OPTS := -B +tst/tests/001/query-5.ok: TXR_OPTS := -B tst/tests/002/%: TXR_OPTS := -C 142 -DTESTDIR=tests/002 tst/tests/004/%: TXR_ARGS := -a 123 -b -c tst/tests/005/%: TXR_ARGS := tests/005/data diff --git a/tests/001/query-5.expected b/tests/001/query-5.expected new file mode 100644 index 00000000..dddf7240 --- /dev/null +++ b/tests/001/query-5.expected @@ -0,0 +1,7 @@ +cmd-rx="#/sshd.*/" +cmd[0]="sshd: kaz [priv] " +cmd[1]="sshd: kaz@pts/2 " +cmd[2]="sshd: kaz [priv] " +cmd[3]="sshd: kaz@pts/4 " +cmd[4]="sshd: kaz [priv] " +cmd[5]="sshd: kaz@pts/1 " diff --git a/tests/001/query-5.txr b/tests/001/query-5.txr new file mode 100644 index 00000000..7c1ca45d --- /dev/null +++ b/tests/001/query-5.txr @@ -0,0 +1,4 @@ +@(bind cmd-rx #/sshd.*/) +@(collect) +@nil @nil @nil @nil @nil @nil @nil @{cmd cmd-rx} +@(end) diff --git a/tests/017/glob-carray.expected b/tests/017/glob-carray.expected index ac1290e3..cf4b8a5e 100644 --- a/tests/017/glob-carray.expected +++ b/tests/017/glob-carray.expected @@ -1,4 +1,4 @@ 0 -#S(glob-t pathc 4 pathv #> reserve 0) +#S(glob-t pathc 5 pathv #> reserve 0) #("tests/001/query-1.txr" "tests/001/query-2.txr" "tests/001/query-3.txr" - "tests/001/query-4.txr") + "tests/001/query-4.txr" "tests/001/query-5.txr") diff --git a/tests/017/glob-zarray.expected b/tests/017/glob-zarray.expected index cd54b421..f15829ea 100644 --- a/tests/017/glob-zarray.expected +++ b/tests/017/glob-zarray.expected @@ -1,4 +1,4 @@ 0 -#S(glob-t pathc 4 pathv #("tests/001/query-1.txr" "tests/001/query-2.txr" "tests/001/query-3.txr" - "tests/001/query-4.txr") +#S(glob-t pathc 5 pathv #("tests/001/query-1.txr" "tests/001/query-2.txr" "tests/001/query-3.txr" + "tests/001/query-4.txr" "tests/001/query-5.txr") reserve 0) -- cgit v1.2.3