randomtest fixes
[platform/upstream/busybox.git] / testsuite / fold.tests
1 #!/bin/sh
2 # Copyright 2009 by Denys Vlasenko
3 # Licensed under GPL v2, see file LICENSE for details.
4
5 . ./testing.sh
6
7 # testing "test name" "options" "expected result" "file input" "stdin"
8
9 testing "fold -s" "fold -w 7 -s" \
10         "123456\n\t\nasdf" \
11         "" \
12         "123456\tasdf" \
13
14 testing "fold -w1" "fold -w1" \
15         "q\nq\n \nw\n \ne\ne\ne\n \nr\n \nt\nt\nt\nt\n \ny" \
16         "" \
17         "qq w eee r tttt y" \
18
19 testing "fold with NULs" "fold -sw22" \
20         "\
21 The NUL is here:>\0< \n\
22 and another one is \n\
23 here:>\0< - they must \n\
24 be preserved
25 " \
26         "" \
27         "The NUL is here:>\0< and another one \
28 is here:>\0< - they must be preserved
29 " \
30
31 optional UNICODE_SUPPORT
32 # The text was taken from English and Ukrainian wikipedia pages
33 testing "fold -sw66 with unicode input" "fold -sw66" \
34         "\
35 The Andromeda Galaxy (pronounced /ænˈdrɒmədə/, also known as \n\
36 Messier 31, M31, or NGC224; often referred to as the Great \n\
37 Andromeda Nebula in older texts) is a spiral galaxy approximately \n\
38 2,500,000 light-years (1.58×10^11 AU) away in the constellation \n\
39 Andromeda. It is the nearest spiral galaxy to our own, the Milky \n\
40 Way.\n\
41 Галактика або Туманність Андромеди (також відома як M31 за \n\
42 каталогом Мессьє та NGC224 за Новим загальним каталогом) — \n\
43 спіральна галактика, що знаходиться на відстані приблизно у 2,5 \n\
44 мільйони світлових років від нашої планети у сузір'ї Андромеди. \n\
45 На початку ХХІ ст. в центрі галактики виявлено чорну дірку." \
46         "" \
47         "\
48 The Andromeda Galaxy (pronounced /ænˈdrɒmədə/, also known as \
49 Messier 31, M31, or NGC224; often referred to as the Great \
50 Andromeda Nebula in older texts) is a spiral galaxy approximately \
51 2,500,000 light-years (1.58×10^11 AU) away in the constellation \
52 Andromeda. It is the nearest spiral galaxy to our own, the Milky \
53 Way.
54 Галактика або Туманність Андромеди (також відома як M31 за \
55 каталогом Мессьє та NGC224 за Новим загальним каталогом) — \
56 спіральна галактика, що знаходиться на відстані приблизно у 2,5 \
57 мільйони світлових років від нашої планети у сузір'ї Андромеди. \
58 На початку ХХІ ст. в центрі галактики виявлено чорну дірку."
59 SKIP=
60
61 exit $FAILCOUNT