aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-08-22 09:17:10 +0100
committerRon Yorston <rmy@pobox.com>2021-08-22 09:17:10 +0100
commit46c5767e7e39d1e173e382bda86ab88b4cad354d (patch)
treed22c7f2376527aebd556eec36e115f037f8a467e /testsuite
parentf13defb1c8f892ecf3e8dd5dbe486cc2b53e6f03 (diff)
parent74c4f356aee9c64978a881e5760055d0e3510a6a (diff)
downloadbusybox-w32-46c5767e7e39d1e173e382bda86ab88b4cad354d.tar.gz
busybox-w32-46c5767e7e39d1e173e382bda86ab88b4cad354d.tar.bz2
busybox-w32-46c5767e7e39d1e173e382bda86ab88b4cad354d.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/rev.tests46
1 files changed, 46 insertions, 0 deletions
diff --git a/testsuite/rev.tests b/testsuite/rev.tests
new file mode 100755
index 000000000..dd65dcd3b
--- /dev/null
+++ b/testsuite/rev.tests
@@ -0,0 +1,46 @@
1#!/bin/sh
2# Copyright 2021 by Ron Yorston
3# Licensed under GPLv2, see file LICENSE in this source tree.
4
5. ./testing.sh
6
7# testing "test name" "commands" "expected result" "file input" "stdin"
8
9testing "rev works" \
10 "rev input" \
11"\
121 enil
13
143 enil
15" \
16 "line 1\n\nline 3\n" \
17 ""
18
19testing "rev file with missing newline" \
20 "rev input" \
21"\
221 enil
23
243 enil" \
25 "line 1\n\nline 3" \
26 ""
27
28testing "rev file with NUL character" \
29 "rev input" \
30"\
31nil
323 enil
33" \
34 "lin\000e 1\n\nline 3\n" \
35 ""
36
37testing "rev file with long line" \
38 "rev input" \
39"\
40+--------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------
41cba
42" \
43 "---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+--------------+\nabc\n" \
44 ""
45
46exit $FAILCOUNT