Skip to content

Commit 7b10ce1

Browse files
committed
Test: Added Fetch message
1 parent d930b90 commit 7b10ce1

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ set -e
33

44
if [ -z "${BF}" ]; then
55
BF="`realpath brainfunk`"
6+
else
7+
BF="`realpath $BF`"
68
fi
79

810
msg_echo()
@@ -19,6 +21,7 @@ fetch()
1921
{
2022
local url="$1"
2123
if [ -f "${i##*/}" ]; then
24+
msg_echo "Fetching $url"
2225
curl -OJv "$url"
2326
fi
2427
}
@@ -35,10 +38,10 @@ test_from_url()
3538

3639

3740
msg_echo "Testing Basic Loop, see if it coredumps" "-[>+<-]"
38-
( ${BF} -c '-[>+<-]' ) && response "PASS"
41+
( ${BF} -c '-[>+<-]' ) && response "PASS" || response "FAIL"
3942

4043
msg_echo "Hello World Test"
41-
( ${BF} -c '++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.' ) && response "PASS"
44+
( ${BF} -c '++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.' ) && response "PASS" || response "FAIL"
4245

4346
msg_echo "Downloading More Tests from Internet"
4447
mkdir -p test
@@ -49,9 +52,7 @@ tar -xpf brainf_progs.tar
4952

5053
for i in bench.b long.b; do
5154
msg_echo "Testing ${i%.b}"
52-
${BF} -f $i && response "PASS"
55+
${BF} -f $i && response "PASS" || response "FAIL"
5356
done
5457

5558
test_from_url https://raw.githubusercontent.com/pablojorge/brainfuck/master/programs/sierpinski.bf
56-
57-
cd ..

0 commit comments

Comments
 (0)