Skip to content
This repository has been archived by the owner on Jun 7, 2020. It is now read-only.

Commit

Permalink
Add some expression tests
Browse files Browse the repository at this point in the history
  • Loading branch information
martinkobelka committed Nov 22, 2017
1 parent e7d5738 commit 28acfb3
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ifj2017/tests/04_expressions/25.code
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
' Many brackets
scope
dim a as integer = 10
print (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((a)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))));
end scope
1 change: 1 addition & 0 deletions ifj2017/tests/04_expressions/25.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10
6 changes: 6 additions & 0 deletions ifj2017/tests/04_expressions/26.code
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
' Too Many brackets
scope
dim a as integer = 10
dim b as integer = 40
print (((((((((((((((((((((((((((((((a))))))))))))))))*(((((((((((((((((((((((((((((((b)*a)))))))))))))))))*(((((((((((((((((((((((((((((((b)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))*(((((((((((((((((((((((((((((((a)))))))))))))))))))))))))))))));
end scope
1 change: 1 addition & 0 deletions ifj2017/tests/04_expressions/26.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1600000
4 changes: 4 additions & 0 deletions ifj2017/tests/04_expressions/27.code
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
' Divide priority (fail types)
scope
print 100000\3/4\4\4/6;
end scope
4 changes: 4 additions & 0 deletions ifj2017/tests/04_expressions/28.code
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
' Divide priority 2 (fail types)
scope
print 10000000/3\4/4
end scope
4 changes: 4 additions & 0 deletions ifj2017/tests/04_expressions/29.code
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
' Bracket, \ and /
scope
print (7\4)/2;
end scope
1 change: 1 addition & 0 deletions ifj2017/tests/04_expressions/29.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.5
4 changes: 4 additions & 0 deletions ifj2017/tests/04_expressions/30.code
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
' Divide priority 2 (fail types)
scope
print 7\4/2
end scope
20 changes: 20 additions & 0 deletions ifj2017/tests/04_expressions/tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,26 @@
"info": "Print boolean expr 2",
"stdout": "false",
"code": "scope \n print 2 > 2.3;\n end scope"
},
{
"name": "24",
"timeout": 1
},
{
"name": "25",
"timeout": 1
},
{
"name": "27",
"compiler_exit_code": 4
},
{
"name": "28",
"compiler_exit_code": 4
},
{
"name": "30",
"compiler_exit_code": 4
}
]
}

0 comments on commit 28acfb3

Please sign in to comment.