From dc0f68d6d4a2c7f956014276995105305f3d28a5 Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Sat, 16 Jul 2016 20:48:19 -0400 Subject: [PATCH] Add a few more LIST test cases. --- tests/Makefile.am | 2 +- tests/list.result6 | 25 +++++++++++++++++++++++++ tests/list.result7 | 25 +++++++++++++++++++++++++ tests/list.result8 | 21 +++++++++++++++++++++ tests/list.test | 24 ++++++++++++++++++++++++ 5 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 tests/list.result6 create mode 100644 tests/list.result7 create mode 100644 tests/list.result8 diff --git a/tests/Makefile.am b/tests/Makefile.am index 7b45660b..348c6087 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -9,7 +9,7 @@ EXTRA_DIST= common.sh passphrase.key datafile.xml \ rename.result3 realpath.test realpath.result2 \ import.test import.result2 import.result3 import.result4 \ import.result5 import.result6 import.result7 xpath.result3 \ - xpath.result4 xpath.test \ + xpath.result4 xpath.test list.result6 list.result7 list.result8 \ acl.test acl.xml acl.result1 acl.result11 move.result9 \ acl.result13 acl.result16 acl.result18 acl.result19 \ acl.result20 acl.result21 .gnupg save.test keyparams.xml diff --git a/tests/list.result6 b/tests/list.result6 new file mode 100644 index 00000000..b01f256d --- /dev/null +++ b/tests/list.result6 @@ -0,0 +1,25 @@ +a + +a b + +a b c OT c d b +a c + +a c d +b +T a +b b + +b b c OT c d b +b c + +b c d +bad_target ET non-existant +target-loop-a OT target-loop-b +target-loop-b OT target-loop-a +c + +c d +T a +c d b + +c d b c OT c d b +c d c + +c d c d +c e +d + +d e +x + +x y T z +z \ No newline at end of file diff --git a/tests/list.result7 b/tests/list.result7 new file mode 100644 index 00000000..d5fe8a5a --- /dev/null +++ b/tests/list.result7 @@ -0,0 +1,25 @@ +a + +a b + +a b c OT c d +a c + +a c d +b +T a +b b + +b b c OT c d +b c + +b c d +bad_target ET non-existant +target-loop-a OT target-loop-b +target-loop-b OT target-loop-a +c + +c d +T a +c d b + +c d b c OT c d +c d c + +c d c d +c e +d + +d e +x + +x y T z +z \ No newline at end of file diff --git a/tests/list.result8 b/tests/list.result8 new file mode 100644 index 00000000..9e06e467 --- /dev/null +++ b/tests/list.result8 @@ -0,0 +1,21 @@ +a + +a b + +a b c OT c +a c + +a c d +b +T a +b b + +b b c OT c +b c + +b c d +bad_target ET non-existant +target-loop-a OT target-loop-b +target-loop-b OT target-loop-a +c + +c d OT a +c e +d + +d e +x + +x y T z +z \ No newline at end of file diff --git a/tests/list.test b/tests/list.test index e84ded58..d5f3c4ef 100755 --- a/tests/list.test +++ b/tests/list.test @@ -43,4 +43,28 @@ echo "Test 5. List element with target attribute error." echo -ne 'LIST --recurse target-loop-a' | pwmc $PWMC_ARGS list > result cmp list.result5 result rm -f result + +echo +echo "Test 6. Recursion loop flags." +echo -ne 'ATTR SET target c\td a' | pwmc $PWMC_ARGS -S list +echo -ne 'ATTR SET target a\tb\tc c\td\tb' | pwmc $PWMC_ARGS -S list +echo -ne 'LIST --recurse' | pwmc $PWMC_ARGS list > result +cmp list.result6 result +rm -f result +echo + +echo +echo "Test 7. Recursion loop flags: no child of target." +echo -ne 'ATTR SET target a\tb\tc c\td' | pwmc $PWMC_ARGS -S list +echo -ne 'LIST --recurse' | pwmc $PWMC_ARGS list > result +cmp list.result7 result +rm -f result + +echo +echo "Test 8. Recursion loop flags: target not a target." +echo -ne 'ATTR SET target a\tb\tc c' | pwmc $PWMC_ARGS -S list +echo -ne 'LIST --recurse' | pwmc $PWMC_ARGS list > result +cmp list.result8 result +rm -f result + test_success -- 2.11.4.GIT