fold.test 513 B

123456789101112131415
  1. #!/bin/bash
  2. [ -f testing.sh ] && . testing.sh
  3. #testing "name" "command" "result" "infile" "stdin"
  4. #copied from gnu, but according to what i understand the output should be.
  5. testing "fold_test_1" "fold -w2 -s" "a\t\n" "" "a\t"
  6. testing "fold_test_2" "fold -w4 -s" "abcd\nef \nd\n" "" "abcdef d\n"
  7. testing "fold_test_3" "fold -w4 -s" "a \ncd \nfgh\n" "" "a cd fgh\n"
  8. testing "fold_test_4" "fold -w4 -s" "abc \nef\n" "" "abc ef\n"
  9. #the question i posted
  10. testing "fold_test_5" "fold -w1" "a\nb\nc\nd\n" "" "abcd"