diff options
| author | mryouse | 2022-07-03 01:00:18 +0000 |
|---|---|---|
| committer | mryouse | 2022-07-03 01:00:18 +0000 |
| commit | e169e50e9d2ab5584e3b72ed069e7695a123e1e7 (patch) | |
| tree | 47c0ec4120518807e3a60a133502e9e84f126153 /tests/runner.bash | |
| parent | 74a048dd493788bab9f9c93b0ed6d925a998822b (diff) | |
initial commit of tests for math things
Diffstat (limited to 'tests/runner.bash')
| -rwxr-xr-x | tests/runner.bash | 22 |
1 files changed, 22 insertions, 0 deletions
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%)" |
