summaryrefslogtreecommitdiffstats
path: root/test.sh
diff options
context:
space:
mode:
authorgramanas <anastasis.gramm2@gmail.com>2020-10-18 01:37:58 +0300
committergramanas <anastasis.gramm2@gmail.com>2020-10-18 01:37:58 +0300
commitfe9c54c24affd5c741031cf0c5f0bdf3c4fff31a (patch)
tree05cda6915754636037cd0ceaeab2e766cc1f2ee9 /test.sh
downloadconf-fe9c54c24affd5c741031cf0c5f0bdf3c4fff31a.tar.gz
conf-fe9c54c24affd5c741031cf0c5f0bdf3c4fff31a.tar.bz2
conf-fe9c54c24affd5c741031cf0c5f0bdf3c4fff31a.zip
Initial..
Diffstat (limited to 'test.sh')
-rwxr-xr-xtest.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/test.sh b/test.sh
new file mode 100755
index 0000000..6dc38e6
--- /dev/null
+++ b/test.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+CONF=$(realpath conf)
+CONF_HOME=$(mktemp -d)
+export CONF_HOME
+
+conf1=$(mktemp)
+conf2=$(mktemp)
+conf3=$(mktemp)
+conf4=$(mktemp)
+conf5=$(mktemp)
+
+echo "test config 1" > "$conf1"
+echo "test config 2" > "$conf2"
+echo "test config 3" > "$conf3"
+echo "test config 4" > "$conf4"
+echo "test config 5" > "$conf5"
+
+$CONF add "$conf1"
+$CONF add -g conf "$conf2" "$conf3"
+$CONF add -g conf "$conf4"
+$CONF add -g other "$conf5"
+
+[ "$($CONF ls -l | wc -l)" != "5" ] && echo Test failed
+[ "$($CONF ls | wc -l)" != "8" ] && echo Test failed
+
+rm -rf "$conf1" "$conf2" "$conf3" "$conf4" "$conf5" "$CONF_HOME"
+echo PASS