do-test (774B)
1 #!/bin/sh 2 3 printf "Test 1 - normal:\t" 4 fold -w 20 test1.txt > f.out 5 ufold -w 20 test1.txt > uf.out 6 if diff f.out uf.out 2>/dev/null >/dev/null; then 7 echo PASS 8 else 9 echo FAIL 10 fi 11 rm -f f.out uf.out 12 13 printf "Test 1 - spaces:\t" 14 fold -w 20 -s test1.txt > f.out 15 ufold -w 20 -s test1.txt > uf.out 16 if diff f.out uf.out 2>/dev/null >/dev/null; then 17 echo PASS 18 else 19 echo FAIL 20 fi 21 rm -f f.out uf.out 22 23 printf "Test 2 - normal:\t" 24 fold -w 20 test2.txt > f.out 25 ufold -w 20 test2.txt > uf.out 26 if diff f.out uf.out 2>/dev/null >/dev/null; then 27 echo PASS 28 else 29 echo FAIL 30 fi 31 rm -f f.out uf.out 32 33 printf "Test 2 - spaces:\t" 34 fold -w 20 -s test2.txt > f.out 35 ufold -w 20 -s test2.txt > uf.out 36 if diff f.out uf.out 2>/dev/null >/dev/null; then 37 echo PASS 38 else 39 echo FAIL 40 fi 41 rm -f f.out uf.out