From c69e3dd92f5a773be18ecf8bd04a0046b6bfc9d6 Mon Sep 17 00:00:00 2001 From: gwirn <71886945+gwirn@users.noreply.github.com> Date: Thu, 24 Aug 2023 13:45:35 +0200 Subject: [PATCH] additional test --- src/test.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/test.sh b/src/test.sh index 3311dc8..ebad0c8 100644 --- a/src/test.sh +++ b/src/test.sh @@ -41,3 +41,17 @@ if [[ ! $(cat ../testFiles/testFile1.txt | go run main.go line | grep line | wc else echo "PASS: Pattern matching for input from StdIn " fi + +if [[ ! $(go run main.go wold ../testFiles/* | grep world | wc -l) -eq 6 ]];then + echo "FAILED: Reduced 'world' -> 'wold'" + exit 1 +else + echo "PASS: Reduced 'world' -> 'wold'" +fi + +if [[ ! $(go run main.go wod ../testFiles/* | grep world | wc -l) -eq 0 && ! $(go run main.go wod ../testFiles/* | wc -l) -eq 0 ]];then + echo "FAILED: Reduced 'world' -> 'wold'" + exit 1 +else + echo "PASS: Reduced 'world' -> 'wod'" +fi