summaryrefslogtreecommitdiffstats
path: root/imag-store
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2016-01-31 19:47:46 +0100
committerMatthias Beyer <mail@beyermatthias.de>2016-02-09 13:48:14 +0100
commite4d113cf4f918eac4abd4e10abddbf65e99128e9 (patch)
tree3ea362b457ff5db7f110ab4c83c9fefc92838f98 /imag-store
parent2b39b8eed744cf23d5256f1d2f13531f3e3886e3 (diff)
Add test for custom header and content
Diffstat (limited to 'imag-store')
-rw-r--r--imag-store/tests/001-create_test.sh36
1 files changed, 31 insertions, 5 deletions
diff --git a/imag-store/tests/001-create_test.sh b/imag-store/tests/001-create_test.sh
index 5a65d122..a944ad3a 100644
--- a/imag-store/tests/001-create_test.sh
+++ b/imag-store/tests/001-create_test.sh
@@ -65,9 +65,35 @@ EOS
fi
}
-invoke_tests \
- test_call \
- test_mkstore \
- test_std_header \
- test_std_header_plus_custom
+test_std_header_plus_custom_and_content() {
+ local expected=$(cat <<EOS
+---
+[imag]
+links = []
+version = "0.1.0"
+
+[zzz]
+zzz = "z"
+---
+content
+EOS
+)
+
+ local name="test-std-header-plus-custom-and-content"
+ imag-store create -p /$name entry -h zzz.zzz=z -c content
+ local result=$(cat ${STORE}/$name)
+ if [[ "$expected" == "$result" ]]; then
+ out "Expected store entry == result"
+ else
+ err "${STORE}/test differs from expected"
+ return 1
+ fi
+}
+
+invoke_tests \
+ test_call \
+ test_mkstore \
+ test_std_header \
+ test_std_header_plus_custom \
+ test_std_header_plus_custom_and_content