Skip to content

Commit

Permalink
fix: test paths and ABC test
Browse files Browse the repository at this point in the history
Tests can now be ran no matter where you are located
ABC now checks against two different expected outputs

---

* Closes #10

---
  • Loading branch information
AksharP5 committed Mar 15, 2024
1 parent 277f6e6 commit d6312e2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions ABC/tests/bear-fuzzy-wuzzy/ABC.expected2
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@


2 matches:
bear(fuzzy)
bear(wuzzy)

3 changes: 2 additions & 1 deletion ABC/tests/bear-fuzzy-wuzzy/ABCtest.bats
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ teardown() {
@test "ABC bear-fuzzy-wuzzy" {
RESULT="$(java -cp abcdatalog.jar:Java Rep -n < ./tests/bear-fuzzy-wuzzy/ABC.input)"
expected_output=$(< "./tests/bear-fuzzy-wuzzy/ABC.expected")
[[ "$RESULT" == "$expected_output" ]]
expected_output2=$(< "./tests/bear-fuzzy-wuzzy/ABC.expected2")
[[ "$RESULT" == "$expected_output" || "$RESULT" == "$expected_output2" ]]
}
4 changes: 4 additions & 0 deletions bin/test.bash
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
PROJECT_ROOT="$( cd "${SCRIPT_DIR}/.." &> /dev/null && pwd )"
cd "${PROJECT_ROOT}"

bats --recursive .

0 comments on commit d6312e2

Please sign in to comment.