diff options
author | Tomas Heinrich <heinrich.tomas@gmail.com> | 2010-04-29 13:43:39 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-04-29 13:43:39 +0200 |
commit | a659b81dfa435aa19130a8c7dd1bfe8fa9a22131 (patch) | |
tree | 6e42922ad325142290898143818bcd819f799c27 /testsuite | |
parent | 25b10d97e66a74d4e5a5571afb1b8369c31eefca (diff) | |
download | busybox-w32-a659b81dfa435aa19130a8c7dd1bfe8fa9a22131.tar.gz busybox-w32-a659b81dfa435aa19130a8c7dd1bfe8fa9a22131.tar.bz2 busybox-w32-a659b81dfa435aa19130a8c7dd1bfe8fa9a22131.zip |
libbb/lineedit: add support for preserving "broken" (non-unicode) chars
Signed-off-by: Tomas Heinrich <heinrich.tomas@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/ash.tests | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/testsuite/ash.tests b/testsuite/ash.tests index 6b2caf316..ce585beb1 100755 --- a/testsuite/ash.tests +++ b/testsuite/ash.tests | |||
@@ -7,8 +7,30 @@ | |||
7 | 7 | ||
8 | . ./testing.sh | 8 | . ./testing.sh |
9 | 9 | ||
10 | test -f "$bindir/.config" && . "$bindir/.config" | ||
11 | |||
10 | # testing "test name" "options" "expected result" "file input" "stdin" | 12 | # testing "test name" "options" "expected result" "file input" "stdin" |
11 | 13 | ||
14 | if test x"$CONFIG_UNICODE_PRESERVE_BROKEN" = x"y"; then | ||
15 | testing "One byte which is not valid unicode char followed by valid input" \ | ||
16 | "script -q -c 'ash' /dev/null >/dev/null; cat ash.output" \ | ||
17 | "\ | ||
18 | 00000000 ff 2d 0a |.-.| | ||
19 | 00000003 | ||
20 | " \ | ||
21 | "" \ | ||
22 | "echo \xff- | hexdump -C >ash.output; exit; exit; exit; exit\n" | ||
23 | |||
24 | testing "30 bytes which are not valid unicode chars followed by valid input" \ | ||
25 | "script -q -c 'ash' /dev/null >/dev/null; cat ash.output" \ | ||
26 | "\ | ||
27 | 00000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | ||
28 | 00000010 ff ff ff ff ff ff ff ff ff ff ff ff ff ff 2d 0a |..............-.| | ||
29 | 00000020 | ||
30 | " \ | ||
31 | "" \ | ||
32 | "echo \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff- | hexdump -C >ash.output; exit; exit; exit; exit\n" | ||
33 | else | ||
12 | testing "One byte which is not valid unicode char followed by valid input" \ | 34 | testing "One byte which is not valid unicode char followed by valid input" \ |
13 | "script -q -c 'ash' /dev/null >/dev/null; cat ash.output" \ | 35 | "script -q -c 'ash' /dev/null >/dev/null; cat ash.output" \ |
14 | "\ | 36 | "\ |
@@ -27,6 +49,8 @@ testing "30 bytes which are not valid unicode chars followed by valid input" \ | |||
27 | " \ | 49 | " \ |
28 | "" \ | 50 | "" \ |
29 | "echo \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff- | hexdump -C >ash.output; exit; exit; exit; exit\n" | 51 | "echo \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff- | hexdump -C >ash.output; exit; exit; exit; exit\n" |
52 | fi | ||
53 | |||
30 | 54 | ||
31 | # Not sure this behavior is perfect: we lose all invalid input which precedes | 55 | # Not sure this behavior is perfect: we lose all invalid input which precedes |
32 | # arrow keys and such. In this example, \xff\xff are lost | 56 | # arrow keys and such. In this example, \xff\xff are lost |