Skip to content

Commit a27f12a

Browse files
8.2.1 Release
2 parents 03cec31 + 49aef33 commit a27f12a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+2577
-933
lines changed

Public/CITests/testMutateClient.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def test_conf_file_inputs(self) -> None:
127127
bad_location = f'"manual_mutants": [{{ "file_to_mutate": "{_p("A.sol")}", "mutants_location": "{_p("bad_location")}"}}]'
128128
suite.expect_failure(description="manual_mutants object missing file_to_mutate",
129129
replacements=TestUtil.replace_x(bad_location),
130-
expected="Invalid mutants location")
130+
expected="Invalid file for mutants location")
131131

132132
def test_invalid_runs(self) -> None:
133133
suite = MutantTestSuite(conf_file_template=_p('mutation_conf_top_level.conf'),
@@ -187,7 +187,7 @@ def test_compile_mutation(self) -> None:
187187
mutation_attrs['manual_mutants'][0]['mutants_location'] = "does_not_exist"
188188
suite.expect_failure(description="single manual mutation - bad location",
189189
replacements=TestUtil.replace_x(TestUtil.json_to_str(mutation_attrs)),
190-
expected="Invalid mutants location")
190+
expected="Invalid file for mutants location")
191191

192192
def test_mutations_flags(self) -> None:
193193

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"files": [
3+
"Test.sol"
4+
],
5+
"msg": "buggy havoc",
6+
"solc": "solc8.28",
7+
"verify": "Test:Havoc.spec"
8+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
rule testHavoc() {
2+
env e;
3+
uint before = currentContract.i;
4+
storage init = lastStorage;
5+
6+
changeI(e, 2);
7+
8+
havoc currentContract.i;
9+
require currentContract.i == before, "putting back the old value";
10+
11+
// this should succeed thanks to the havoc and require
12+
assert lastStorage == init;
13+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
contract Test {
2+
uint public i;
3+
4+
function changeI(uint val) external {
5+
i = val;
6+
}
7+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"rules": {
3+
"testHavoc": "SUCCESS"
4+
}
5+
}

0 commit comments

Comments
 (0)