]> pilppa.org Git - uci.git/blobdiff - test/tests.d/030_set
Adds a unit test framework based on shunit2
[uci.git] / test / tests.d / 030_set
diff --git a/test/tests.d/030_set b/test/tests.d/030_set
new file mode 100644 (file)
index 0000000..8f695ed
--- /dev/null
@@ -0,0 +1,20 @@
+test_set_named_section()
+{
+       touch ${CONFIG_DIR}/set
+       ${UCI} set set.section=named
+       assertSameFile ${REF_DIR}/set_named_section.result ${CHANGES_DIR}/set
+}
+
+test_set_nonexisting_option()
+{
+       cp ${REF_DIR}/set_nonexisting_option.data ${CONFIG_DIR}/set
+       ${UCI} set set.section.opt=val
+       assertSameFile ${REF_DIR}/set_nonexisting_option.result ${CHANGES_DIR}/set
+}
+
+test_set_existing_option()
+{
+       cp ${REF_DIR}/set_existing_option.data ${CONFIG_DIR}/set
+       ${UCI} set set.section.opt=val
+       assertSameFile ${REF_DIR}/set_existing_option.result ${CHANGES_DIR}/set
+}