~strahinja/ufold

9a7475e8c665fdb1323bffa05f74ddd63d96cc09 — Страхиња Радић 5 months ago f8f272b
test.do: New file; do-test: Convert to POSIX

Signed-off-by: Страхиња Радић <contact@strahinja.org>
2 files changed, 25 insertions(+), 9 deletions(-)

M do-test
A test.do
M do-test => do-test +24 -9
@@ 1,26 1,41 @@
#!/bin/sh

echo -ne "Test 1 - normal:\t"
printf "Test 1 - normal:\t"
fold -w 20 test1.txt > f.out
ufold -w 20 test1.txt > uf.out
diff f.out uf.out 2>/dev/null >/dev/null && echo "PASS" || echo "FAIL"
if diff f.out uf.out 2>/dev/null >/dev/null; then
	echo PASS
else
	echo FAIL
fi
rm -f f.out uf.out

echo -ne "Test 1 - spaces:\t"
printf "Test 1 - spaces:\t"
fold -w 20 -s test1.txt > f.out
ufold -w 20 -s test1.txt > uf.out
diff f.out uf.out 2>/dev/null >/dev/null && echo "PASS" || echo "FAIL"
if diff f.out uf.out 2>/dev/null >/dev/null; then
	echo PASS
else
	echo FAIL
fi
rm -f f.out uf.out

echo -ne "Test 2 - normal:\t"
printf "Test 2 - normal:\t"
fold -w 20 test2.txt > f.out
ufold -w 20 test2.txt > uf.out
diff f.out uf.out 2>/dev/null >/dev/null && echo "PASS" || echo "FAIL"
if diff f.out uf.out 2>/dev/null >/dev/null; then
	echo PASS
else
	echo FAIL
fi
rm -f f.out uf.out

echo -ne "Test 2 - spaces:\t"
printf "Test 2 - spaces:\t"
fold -w 20 -s test2.txt > f.out
ufold -w 20 -s test2.txt > uf.out
diff f.out uf.out 2>/dev/null >/dev/null && echo "PASS" || echo "FAIL"
if diff f.out uf.out 2>/dev/null >/dev/null; then
	echo PASS
else
	echo FAIL
fi
rm -f f.out uf.out


A test.do => test.do +1 -0
@@ 0,0 1,1 @@
./do-test >&2