From e169e50e9d2ab5584e3b72ed069e7695a123e1e7 Mon Sep 17 00:00:00 2001 From: mryouse Date: Sun, 3 Jul 2022 01:00:18 +0000 Subject: initial commit of tests for math things --- tests/runner.bash | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 tests/runner.bash (limited to 'tests/runner.bash') diff --git a/tests/runner.bash b/tests/runner.bash new file mode 100755 index 0000000..32af554 --- /dev/null +++ b/tests/runner.bash @@ -0,0 +1,22 @@ +#!/bin/bash +passed=0 +total=0 +for item in $(find . -name *.neb) +do + expected=$(tail -1 $item | sed 's/; //') + actual=$(python3 ../neb.py $item) + if [[ "$expected" == "$actual" ]]; then + ((passed=passed+1)) + else + echo "$item... FAILED" + echo " Expected: $expected" + echo " Actual: $actual" + echo "" + fi + ((total=total+1)) +done + +pct=$(python -c "print('{:.2f}'.format($passed / float($total) * 100))") + +echo "Total: $total" +echo "Passed: $passed ($pct%)" -- cgit v1.2.3