parser start
This commit is contained in:
parent
7fecbd04b3
commit
c76b84682a
14 changed files with 589 additions and 21 deletions
1
test/parser/1.in
Normal file
1
test/parser/1.in
Normal file
|
|
@ -0,0 +1 @@
|
|||
42
|
||||
3
test/parser/1.out
Normal file
3
test/parser/1.out
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
Module
|
||||
ExprStmt
|
||||
Number(42)
|
||||
|
|
@ -1,15 +1,30 @@
|
|||
#!/bin/bash
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
cd "$(dirname "$0")" # Change to script directory
|
||||
|
||||
echo "=== LEXER TESTS ==="
|
||||
for test in lexer/*.in; do
|
||||
name=$(basename "$test" .in)
|
||||
echo "Testing $name..."
|
||||
echo "Testing lexer/$name..."
|
||||
|
||||
if ! ../build/py2rb --dump-tokens < "$test" | diff - "lexer/${name}.out"; then
|
||||
echo "FAILED: $name"
|
||||
echo "FAILED: lexer/$name"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
echo "✓ All lexer tests passed"
|
||||
|
||||
echo ""
|
||||
echo "=== PARSER TESTS ==="
|
||||
for test in parser/*.in; do
|
||||
name=$(basename "$test" .in)
|
||||
echo "Testing parser/$name..."
|
||||
|
||||
if ! ../build/py2rb --dump-ast < "$test" | diff - "parser/${name}.out"; then
|
||||
echo "FAILED: parser/$name"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
echo "✓ All parser tests passed"
|
||||
|
||||
echo ""
|
||||
echo "SUCCESS: All tests passed"
|
||||
Loading…
Add table
Add a link
Reference in a new issue