toybox/tests/paste.test
<<
>>
Prefs
   1#!/bin/bash
   2
   3[ -f testing.sh ] && . testing.sh
   4
   5#testing "name" "command" "result" "infile" "stdin"
   6
   7UTFTEST="$(echo -e '\xcc\xb4\xcc\x97\xcc\x9e\xcc\xa0\x65')"
   8echo -e "one1\none2\none3" > one
   9echo -e "two1\ntwo2\ntwo3" > two
  10touch three four
  11echo five > five
  12testing "" "paste one two" "one1\ttwo1\none2\ttwo2\none3\ttwo3\n" "" ""
  13testing "" "paste -s one two" "one1\tone2\tone3\ntwo1\ttwo2\ttwo3\n" "" ""
  14testing "" "paste -s three four" "\n\n" "" ""
  15testing "" "paste three four" "" "" ""
  16testing "" "paste - - -" "uno\tdos\tdesqview\nunix\t\t\n" "" "uno\ndos\ndesqview\nunix\n"
  17testing "" "paste - - - -d ''" "unodosdesqview\nunix\n" "" "uno\ndos\ndesqview\nunix\n"
  18testing "" "paste one two one two" \
  19  "one1\ttwo1\tone1\ttwo1\none2\ttwo2\tone2\ttwo2\none3\ttwo3\tone3\ttwo3\n" \
  20  "" ""
  21testing "" "paste five three two" "five\t\ttwo1\n\t\ttwo2\n\t\ttwo3\n" "" ""
  22testing "" "paste -d '私\0${UTFTEST}q' - - - - - - " \
  23  "one私twothree${UTFTEST}fourqfive私six\n7私89${UTFTEST}q私\n" \
  24  "" "one\ntwo\nthree\nfour\nfive\nsix\n7\n8\n9\n"
  25rm -f one two three four
  26unset UTFTEST
  27
  28# test -d \n
  29# test -d \x
  30# test 
  31