-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds regression tests for choose exceeding 10000 choices
- Loading branch information
Showing
5 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
Tst/RegressionTests/Feature3Exprs/DynamicError/tooManyChoicesInt/tooManyChoicesInt.p
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,16 @@ | ||
machine Main { | ||
start state S { | ||
entry { | ||
var x: int; | ||
var y: int; | ||
|
||
x = 10000; | ||
y = choose(x); // OK | ||
print format("y is {0}", y); | ||
|
||
x = 10001; | ||
y = choose(x); // error | ||
print format("y is {0}", y); | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
Tst/RegressionTests/Feature3Exprs/DynamicError/tooManyChoicesMap/tooManyChoicesMap.p
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,22 @@ | ||
machine Main { | ||
start state S { | ||
entry { | ||
var x: map[int, int]; | ||
var y: int; | ||
var i: int; | ||
|
||
i = 0; | ||
while (i < 10000) { | ||
x[i] = i; | ||
i = i + 1; | ||
} | ||
|
||
y = choose(x); // OK | ||
print format("y is {0}", y); | ||
|
||
x[i] = i; | ||
y = choose(x); // error | ||
print format("y is {0}", y); | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
Tst/RegressionTests/Feature3Exprs/DynamicError/tooManyChoicesSeq/tooManyChoicesSeq.p
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,22 @@ | ||
machine Main { | ||
start state S { | ||
entry { | ||
var x: seq[int]; | ||
var y: int; | ||
var i: int; | ||
|
||
i = 0; | ||
while (i < 10000) { | ||
x += (i, i); | ||
i = i + 1; | ||
} | ||
|
||
y = choose(x); // OK | ||
print format("y is {0}", y); | ||
|
||
x += (i, i); | ||
y = choose(x); // error | ||
print format("y is {0}", y); | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
Tst/RegressionTests/Feature3Exprs/DynamicError/tooManyChoicesSet/tooManyChoicesSet.p
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,22 @@ | ||
machine Main { | ||
start state S { | ||
entry { | ||
var x: set[int]; | ||
var y: int; | ||
var i: int; | ||
|
||
i = 0; | ||
while (i < 10000) { | ||
x += (i); | ||
i = i + 1; | ||
} | ||
y = choose(x); // OK | ||
print format("y is {0}", y); | ||
x += (i); | ||
y = choose(x); // error | ||
print format("y is {0}", y); | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
Tst/RegressionTests/Feature3Exprs/StaticError/tooManyChoices/tooManyChoices.p
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,14 @@ | ||
machine Main { | ||
start state S { | ||
entry { | ||
var x: int; | ||
var y: int; | ||
|
||
x = choose(10000); // OK | ||
print format("x is {0}", x); | ||
|
||
y = choose(10001); // error | ||
print format("y is {0}", y); | ||
} | ||
} | ||
} |