Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/freebsd/poudriere.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBryan Drewery <bryan@shatow.net>2018-02-01 22:23:30 +0300
committerBryan Drewery <bryan@shatow.net>2018-02-13 05:43:33 +0300
commitd5cbf3f5d0b2f3ea789ea82b4b01e7aca376d75e (patch)
tree17407b89adcad0f033f49c7604284aa7c737b61b /test
parent1a517de026fbd475b0c71f3c3766dd233cd41432 (diff)
Add list_contains
Diffstat (limited to 'test')
-rw-r--r--test/list.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/list.sh b/test/list.sh
index 2991363b..de44af30 100644
--- a/test/list.sh
+++ b/test/list.sh
@@ -78,21 +78,42 @@ assert_list "" "Expected empty - left"
# Reset so we can test removing the right
LIST=
list_add LIST 01
+assert_ret 0 list_contains LIST 01
+assert_ret 1 list_contains LIST 02
+assert_ret 1 list_contains LIST 03
list_add LIST 02
+assert_ret 0 list_contains LIST 01
+assert_ret 0 list_contains LIST 02
+assert_ret 1 list_contains LIST 03
list_add LIST 03
+assert_ret 0 list_contains LIST 01
+assert_ret 0 list_contains LIST 02
+assert_ret 0 list_contains LIST 03
assert_list "01 02 03" "Expected 01 02 03 - right"
list_remove LIST 03
assert_list "01 02" "Expected 01 02 - right"
+assert_ret 0 list_contains LIST 01
+assert_ret 0 list_contains LIST 02
+assert_ret 1 list_contains LIST 03
list_remove LIST 02
assert_list "01" "Expected 01 - right"
+assert_ret 0 list_contains LIST 01
+assert_ret 1 list_contains LIST 02
+assert_ret 1 list_contains LIST 03
list_remove LIST 02
assert_list "01" "Expected 01 - right"
+assert_ret 0 list_contains LIST 01
+assert_ret 1 list_contains LIST 02
+assert_ret 1 list_contains LIST 03
list_remove LIST 01
assert_list "" "Expected blank - right"
+assert_ret 1 list_contains LIST 01
+assert_ret 1 list_contains LIST 02
+assert_ret 1 list_contains LIST 03
# Test eval parsing
LIST=