summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test-check_is_in.sh7
-rwxr-xr-x[-rw-r--r--]tests/test-menus.sh23
2 files changed, 20 insertions, 10 deletions
diff --git a/tests/test-check_is_in.sh b/tests/test-check_is_in.sh
new file mode 100755
index 0000000..0d97361
--- /dev/null
+++ b/tests/test-check_is_in.sh
@@ -0,0 +1,7 @@
+basedir=$(dirname "`dirname $0`")
+source $basedir/src/core/libs/lib-ui.sh #dependency needed
+source $basedir/src/core/libs/lib-misc.sh
+
+vars=(A B C D E F)
+check_is_in C "${vars[@]}" && echo 'ok C was in there' || echo 'wtf'
+check_is_in AOEUAU "${vars[@]}" && echo wtf || echo 'ok it was not in there'
diff --git a/tests/test-menus.sh b/tests/test-menus.sh
index 9288ff6..b8dd99c 100644..100755
--- a/tests/test-menus.sh
+++ b/tests/test-menus.sh
@@ -1,12 +1,15 @@
basedir=$(dirname "`dirname $0`")
source $basedir/src/core/libs/lib-ui.sh
-ANSWER="/tmp/.dialog-answer"
-
-
-var_UI_TYPE=dia
-ask_option no 'menu title is this yes yes' 'extra explanation is here mkay' tagA itemA "tag B" 'item B' tag-c item\ C
-echo "return code was $?"
-
-var_UI_TYPE=cli
-ask_option tag-c 'menu title is this yes yes' 'extra explanation is here mkay' tagA itemA "tag B" 'item B' tag-c item\ C
-echo "return code was $?" \ No newline at end of file
+ANSWER="/tmp/aif-test-dialog-answer"
+for ui in dia cli
+do
+ for type in required optional
+ do
+ for default in no tag-c
+ do
+ var_UI_TYPE=$ui
+ ask_option $default 'menu title ($2)' 'extra explanation ($3)'" settings: type: $type, default:$default" $type tagA itemA "tag B" 'item B' tag-c item\ C
+ notify "RETURN CODE: $?\nANSWER: $ANSWER_OPTION"
+ done
+ done
+done