+test_get_parsing()
+{
+ cp ${REF_DIR}/get_parsing.data ${CONFIG_DIR}/test
+
+ assertFailWithNoReturn "${UCI} get test."
+ assertFailWithNoReturn "${UCI} get test.section."
+ assertFailWithNoReturn "${UCI} get test.section.opt."
+ assertFailWithNoReturn "${UCI} get test.section.opt.val."
+ assertFailWithNoReturn "${UCI} get test.section.opt.val.qsdf.qsd"
+ assertFailWithNoReturn "${UCI} get test.section.opt.valqsqsd"
+}
+
+test_get_section_index_parsing()
+{
+ cp ${REF_DIR}/get_parsing.data ${CONFIG_DIR}/test
+
+ assertFailWithNoReturn "${UCI} get test.@"
+ assertFailWithNoReturn "${UCI} get test.@zer."
+ assertFailWithNoReturn "${UCI} get test.@."
+ assertFailWithNoReturn "${UCI} get test.@zer[1]"
+ assertFailWithNoReturn "${UCI} get test.@.opt"
+ assertFailWithNoReturn "${UCI} get test.@[28]"
+ assertFailWithNoReturn "${UCI} get test.@[1]."
+ assertFailWithNoReturn "${UCI} get test.@[1].val."
+}
+
test_get_option()
{
cp ${REF_DIR}/get.data ${CONFIG_DIR}/test
+test_set_parsing()
+{
+ cp ${REF_DIR}/set_parsing.data ${CONFIG_DIR}/test
+
+ assertFailWithNoReturn "${UCI} set test.=val"
+ assertFailWithNoReturn "${UCI} set test.section.=val"
+ assertFailWithNoReturn "${UCI} set test.section.opt.=val"
+ assertFailWithNoReturn "${UCI} set test.section.opt.zflk=val"
+}
+
test_set_named_section()
{
touch ${CONFIG_DIR}/set
--- /dev/null
+test_get_parsing()
+{
+ cp ${REF_DIR}/show_parsing.data ${CONFIG_DIR}/test
+
+ assertFailWithNoReturn "${UCI} show test."
+ assertFailWithNoReturn "${UCI} show test.section."
+ assertFailWithNoReturn "${UCI} show test.section.opt."
+ assertFailWithNoReturn "${UCI} show test.section.opt.val."
+ assertFailWithNoReturn "${UCI} show test.section.opt.val.qsdf.qsd"
+ assertFailWithNoReturn "${UCI} show test.section.opt.valqsqsd"
+}
echo "----"
}
}
+assertFailWithNoReturn() {
+ local test="$1"
+ value=$( $test )
+ assertFalse "'$test' does not fail" $?
+ assertNull "'$test' returns '$value'" "$value"
+}
EOF
for suite in $(ls ${SCRIPTS_DIR}/*)