Skip to content

Commit

Permalink
Add tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaby76 committed May 15, 2024
1 parent 15ae8a8 commit df3da02
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions tests/grammars/Up2.g4
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
grammar Up2;
start: a ( b | c )* d;
2 changes: 2 additions & 0 deletions tests/grammars/Up3.g4
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
grammar Up3;
start: a ( v += b )* c;
14 changes: 11 additions & 3 deletions tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,18 @@ where=`pwd`
cd "$where"
echo "$where"
cd "$where"
bash ../find-useless-parentheses.sh grammars/Up1.g4
if [ $? -ne 0 ]
failed=0
for t in grammars/*.g4
do
bash ../find-useless-parentheses.sh $t
if [ $? -ne 0 ]
then
echo Test "'bash ../find-useless-parentheses.sh $t'" failed.
failed=1
fi
done
if [ $failed -ne 0 ]
then
echo Test "'bash ../find-useless-parentheses.sh grammars/Up1.g4'" failed.
exit 1
else
exit 0
Expand Down

0 comments on commit df3da02

Please sign in to comment.