-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #188 from nus-cs3203/add-more-tests
Add more tests
- Loading branch information
Showing
3 changed files
with
100 additions
and
1 deletion.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
Team16/Tests16/Milestone3/Complicated_Source_Valid_Queries/M3_With_Nested_queries.txt
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
1 - Most Basic With clause | ||
procedure p; | ||
Select p with p.procName = "p1" | ||
p1 | ||
5000 | ||
2 - Basic With Clause procedure | ||
procedure p; variable v; | ||
Select p such that Modifies(p, v) with "a" = v.varName | ||
p1 | ||
5000 | ||
3 - Basic With Clause procedure 2 | ||
procedure p; variable v; | ||
Select p such that Modifies(p, v) with v.varName = "a" | ||
p1 | ||
5000 | ||
4 - Basic With Clause which is not there | ||
procedure p; variable v; | ||
Select p such that Modifies(p, v) with "b" = v.varName | ||
none | ||
5000 | ||
5 - Basic With Clause which is not there 2 | ||
procedure p; variable v; | ||
Select p such that Modifies(p, v) with v.varName = "b" | ||
none | ||
5000 | ||
6 - Combine 2 With clauses | ||
procedure p; variable v; | ||
Select p such that Modifies(p, v) with v.varName = "a" with p.procName = "p1" | ||
p1 | ||
5000 | ||
7 - Combine 2 With clauses with empty set | ||
procedure p; variable v; | ||
Select p such that Modifies(p, v) with v.varName = "a" with p.procName = "p2" | ||
none | ||
5000 | ||
8 - Combine 2 With clauses with empty set | ||
procedure p; variable v; | ||
Select p such that Modifies(p, v) with v.varName = "b" with p.procName = "p1" | ||
none | ||
5000 | ||
9 - Select read statement | ||
read r; | ||
Select r such that Modifies(r, "r") with r.stmt# = 9 | ||
9 | ||
5000 | ||
10 - Select read statement | ||
read r; | ||
Select r such that Modifies(r, "p") with r.stmt# = 9 | ||
none | ||
5000 | ||
11 - Select read statement | ||
read r; | ||
Select r such that Modifies(r, "r") with 9 = r.stmt# | ||
9 | ||
5000 | ||
12 - Select assign statement | ||
assign a; | ||
Select a such that Affects(1, a) with a.stmt# = 6 | ||
6 | ||
5000 | ||
13 - Test and clause | ||
stmt s1, s2; variable v; | ||
Select <s1, s2> such that Uses(s1, v) with s2.stmt# = s1.stmt# | ||
1 1, 2 2, 3 3, 4 4, 5 5, 6 6, 7 7 | ||
5000 | ||
|
||
|
||
|
15 changes: 15 additions & 0 deletions
15
Team16/Tests16/Milestone3/Complicated_Source_Valid_Queries/M3_With_Nested_source.txt
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
procedure p1 { | ||
a = b + c; | ||
call p2; | ||
while (! ((a > b)&&( (a == b) || ((a != b) && ((a < b) || ((a <= b) && (a>= (0+(0-(0*(0/(0%(((0))))))))))))))) { | ||
a = 2 + b; | ||
x = a + 2; | ||
} | ||
x = a + 3; | ||
} | ||
|
||
procedure p2 { | ||
p = q + r; | ||
r = 4 + 3; | ||
read r; | ||
} |
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