1 prepare_list_test() { 2 touch ${CONFIG_DIR}/list_test_config 3 ${UCI} set list_test_config.SEC0=section 4 ${UCI} add_list list_test_config.SEC0.list0=value0 5 ${UCI} add_list list_test_config.SEC0.list0='"Hello 6 ,'" world\"" 7 } 8 test_add_list_config() { 9 prepare_list_test 10 ${UCI} commit 11 assertSameFile "${REF_DIR}/add_list_config.result" "$CONFIG_DIR/list_test_config" 12 } 13 14 test_add_list_get() { 15 # To maintain compatibility with current code, do not quote 16 # list values that do not contain blank spaces ("\x20\t\r\n") within it. 17 prepare_list_test 18 value_list_get=$(${UCI} get list_test_config.SEC0.list0) 19 assertEquals "$value_list_get" "value0 '\"Hello 20 , world\"'" 21 } 22 23 test_add_list_show() { 24 prepare_list_test 25 value_list_show=$(${UCI} show list_test_config) 26 value_list_show_ref=$(cat "$REF_DIR/add_list_show.result") 27 assertEquals "$value_list_show" "$value_list_show_ref" 28 } 29 30 test_add_list_changes() { 31 prepare_list_test 32 value_list_changes=$(${UCI} changes) 33 value_list_changes_ref=$(cat "$REF_DIR/add_list_changes.result") 34 assertEquals "$value_list_changes" "$value_list_changes_ref" 35 } 36 37 test_del_list() { 38 prepare_list_test 39 ${UCI} commit 40 ${UCI} del_list list_test_config.SEC0.list0=value0 41 ${UCI} commit 42 assertSameFile "${REF_DIR}/del_list_config.result" "$CONFIG_DIR/list_test_config" 43 } 44 45 test_del_list_multiline() { 46 prepare_list_test 47 ${UCI} commit 48 ${UCI} del_list list_test_config.SEC0.list0='"Hello 49 ,'' world"' 50 ${UCI} commit 51 assertSameFile "${REF_DIR}/del_list_multiline_config.result" "$CONFIG_DIR/list_test_config" 52 }
This page was automatically generated by LXR 0.3.1. • OpenWrt