3 # tests the array sifter methods.
5 source $FEISTY_MEOW_SCRIPTS/core/array_sifter.sh
7 #demo 1 & 2 for test presence.
8 declare -a my_array=(peanuts sauce fish basil)
11 test_presence my_array $test1
13 echo "test1 did not find flag, but should have."
15 echo "test1 found expected flag."
19 test_presence my_array $test2
21 echo "test2 did not find flag, which is correct."
23 echo "test2 found flag when should not have."
26 #############################################
30 declare -a sift_list=(ontrack selenium aggressive)
31 declare -a stripping=(selenium)
32 declare -a store_list=()
34 sift_array "sift_list" "stripping" "store_list"
35 if [ ${store_list[0]} == "selenium" ]; then
36 echo "test3 found expected content in storage list."
38 echo "test3 was missing expected content in storage list."
40 echo sift is now ${sift_list[*]}
41 if [ "${sift_list[*]}" == "ontrack aggressive" ]; then
42 echo "test3 found expected content in sifting list."
44 echo "test3 was missing expected content in sifting list."