-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d577c07
commit 968b84e
Showing
8 changed files
with
46 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
#!/usr/bin/env bats | ||
|
||
teardown() { | ||
rm -rf ${BATS_TMPDIR}/expected.json | ||
rm -rf ${BATS_TMPDIR}/given-grammar.lang | ||
rm -rf ${BATS_TMPDIR}/given-program.lang | ||
rm -rf ${BATS_TMPDIR}/result.json | ||
rm -rf ${BATS_TMPDIR}/Java | ||
} | ||
|
||
@test "PLCC can print JSON AST." { | ||
FILES="expected.json given-grammar.lang given-program.lang" | ||
for f in $FILES ; do | ||
cp "${BATS_TEST_DIRNAME}/${f}" "${BATS_TMPDIR}" | ||
done | ||
|
||
cp "${BATS_TEST_DIRNAME}"/* "$BATS_TMPDIR/" | ||
cd "${BATS_TMPDIR}" | ||
plccmk --json_ast given-grammar.lang | ||
parse -n --json_ast < given-program.lang > result.json | ||
diff expected.json result.json | ||
|
||
for f in $FILES ; do | ||
rm "${BATS_TMPDIR}/${f}" | ||
done | ||
rm "${BATS_TMPDIR}/result.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters