9d2ff4b990e1e5e9c37123a22cd6eb1522418549
[project/uci.git] / test / tests.d / 030_set
1 test_set_parsing()
2 {
3 cp ${REF_DIR}/set_parsing.data ${CONFIG_DIR}/test
4
5 assertFailWithNoReturn "${UCI_Q} set test.=val"
6 assertFailWithNoReturn "${UCI_Q} set test.section.=val"
7 assertFailWithNoReturn "${UCI_Q} set test.section.opt.=val"
8 assertFailWithNoReturn "${UCI_Q} set test.section.opt.zflk=val"
9 }
10
11 test_set_named_section()
12 {
13 touch ${CONFIG_DIR}/set
14 ${UCI} set set.section=named
15 assertSameFile ${REF_DIR}/set_named_section.result ${CHANGES_DIR}/set
16 }
17
18 test_set_nonexisting_option()
19 {
20 cp ${REF_DIR}/set_nonexisting_option.data ${CONFIG_DIR}/set
21 ${UCI} set set.section.opt=val
22 assertSameFile ${REF_DIR}/set_nonexisting_option.result ${CHANGES_DIR}/set
23 }
24
25 test_set_existing_option()
26 {
27 cp ${REF_DIR}/set_existing_option.data ${CONFIG_DIR}/set
28 ${UCI} set set.section.opt=val
29 assertSameFile ${REF_DIR}/set_existing_option.result ${CHANGES_DIR}/set
30 }