Denys Vlasenko | ded688c | 2009-11-04 15:31:19 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # Copyright 2009 by Denys Vlasenko |
Denys Vlasenko | 0ef64bd | 2010-08-16 20:14:46 +0200 | [diff] [blame] | 3 | # Licensed under GPLv2, see file LICENSE in this source tree. |
Denys Vlasenko | ded688c | 2009-11-04 15:31:19 +0100 | [diff] [blame] | 4 | |
Mike Frysinger | caa7940 | 2009-11-04 18:41:22 -0500 | [diff] [blame] | 5 | . ./testing.sh |
Denys Vlasenko | 9297dbc | 2010-07-05 21:37:12 +0200 | [diff] [blame] | 6 | test -f "$bindir/.config" && . "$bindir/.config" |
Denys Vlasenko | ded688c | 2009-11-04 15:31:19 +0100 | [diff] [blame] | 7 | |
| 8 | # testing "test name" "options" "expected result" "file input" "stdin" |
| 9 | |
| 10 | testing "fold -s" "fold -w 7 -s" \ |
Denys Vlasenko | 2805502 | 2010-01-04 20:49:58 +0100 | [diff] [blame] | 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" \ |
Denys Vlasenko | ded688c | 2009-11-04 15:31:19 +0100 | [diff] [blame] | 17 | "" \ |
Denys Vlasenko | 2805502 | 2010-01-04 20:49:58 +0100 | [diff] [blame] | 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 |
Denys Vlasenko | 9297dbc | 2010-07-05 21:37:12 +0200 | [diff] [blame] | 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" \ |
Denys Vlasenko | 2805502 | 2010-01-04 20:49:58 +0100 | [diff] [blame] | 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 | мільйони світлових років від нашої планети у сузір'ї Андромеди. \ |
Denys Vlasenko | e3d90a9 | 2010-05-10 05:53:16 +0200 | [diff] [blame] | 60 | На початку ХХІ ст. в центрі галактики виявлено чорну дірку." |
Denys Vlasenko | ded688c | 2009-11-04 15:31:19 +0100 | [diff] [blame] | 61 | |
| 62 | exit $FAILCOUNT |