Skip to content

Commit df3da02

Browse files
committed
Add tests.
1 parent 15ae8a8 commit df3da02

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

tests/grammars/Up2.g4

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
grammar Up2;
2+
start: a ( b | c )* d;

tests/grammars/Up3.g4

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
grammar Up3;
2+
start: a ( v += b )* c;

tests/test.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,18 @@ where=`pwd`
77
cd "$where"
88
echo "$where"
99
cd "$where"
10-
bash ../find-useless-parentheses.sh grammars/Up1.g4
11-
if [ $? -ne 0 ]
10+
failed=0
11+
for t in grammars/*.g4
12+
do
13+
bash ../find-useless-parentheses.sh $t
14+
if [ $? -ne 0 ]
15+
then
16+
echo Test "'bash ../find-useless-parentheses.sh $t'" failed.
17+
failed=1
18+
fi
19+
done
20+
if [ $failed -ne 0 ]
1221
then
13-
echo Test "'bash ../find-useless-parentheses.sh grammars/Up1.g4'" failed.
1422
exit 1
1523
else
1624
exit 0

0 commit comments

Comments
 (0)