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