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