aboutsummaryrefslogtreecommitdiff
path: root/testsuite/ash.tests
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/ash.tests')
-rwxr-xr-xtestsuite/ash.tests42
1 files changed, 42 insertions, 0 deletions
diff --git a/testsuite/ash.tests b/testsuite/ash.tests
new file mode 100755
index 000000000..4b6efe42c
--- /dev/null
+++ b/testsuite/ash.tests
@@ -0,0 +1,42 @@
1#!/bin/sh
2#
3# These are not ash tests, we use ash as a way to test lineedit!
4#
5# Copyright 2010 by Denys Vlasenko
6# Licensed under GPL v2, see file LICENSE for details.
7
8. ./testing.sh
9
10# testing "test name" "options" "expected result" "file input" "stdin"
11
12testing "One byte which is not valid unicode char followed by valid input" \
13 "script -q -c 'ash' /dev/null >/dev/null; cat output; rm output" \
14 "\
1500000000 3f 2d 0a |?-.|
1600000003
17" \
18 "" \
19 "echo \xff- | hexdump -C >output; exit; exit; exit; exit\n" \
20
21testing "30 bytes which are not valid unicode chars followed by valid input" \
22 "script -q -c 'ash' /dev/null >/dev/null; cat output; rm output" \
23 "\
2400000000 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f |????????????????|
2500000010 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 2d 0a |??????????????-.|
2600000020
27" \
28 "" \
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 >output; exit; exit; exit; exit\n" \
30
31# 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
33testing "2 bytes which are not valid unicode chars followed by left arrow key" \
34 "script -q -c 'ash' /dev/null >/dev/null; cat output; rm output" \
35 "\
3600000000 3d 2d 0a |=-.|
3700000003
38" \
39 "" \
40 "echo =+\xff\xff\x1b\x5b\x44- | hexdump -C >output; exit; exit; exit; exit\n" \
41
42exit $FAILCOUNT