diff options
author | Yousong Zhou <yszhou4tech@gmail.com> | 2015-05-25 20:32:43 +0800 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2015-05-25 23:03:30 +0200 |
commit | a6a745338cd004a88edaaace5ca145a4411cdda9 (patch) | |
tree | 95fc2e3e23d7c61f97e111578cb937603972b618 | |
parent | 4b52bdbdbec3c84afeab5c3167e69f7c6012b2f3 (diff) | |
download | uci-a6a745338cd004a88edaaace5ca145a4411cdda9.tar.gz |
tests: add test case for parsing long option values.
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
-rw-r--r-- | test/tests.d/070_revert | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/tests.d/070_revert b/test/tests.d/070_revert index 6035f6f..fc9f5f3 100644 --- a/test/tests.d/070_revert +++ b/test/tests.d/070_revert @@ -26,3 +26,22 @@ test_revert_option_multiline() ${UCI} revert revert.SEC0.option1 assertSameFile "${REF_DIR}/revert_option_multiline.result" "$CHANGES_DIR/revert" } + +test_revert_option_long() +{ + local val="$(head -c 8192 < /dev/zero | tr '\0' 'a')" + local res + + touch ${CONFIG_DIR}/p + + ${UCI} set p.s=sec + ${UCI} set p.s.o="$val" + + res="$(${UCI} changes)" + assertEquals "p.s='sec' +p.s.o='$val'" "$res" + + ${UCI} revert p + res="$(${UCI} changes)" + assertEquals "" "$res" +} |