Skip to content

Commit 44c86e7

Browse files
authored
chore: fix getArtifactPath flaky test (#9339)
1 parent e649e62 commit 44c86e7

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

testdata/default/cheats/GetArtifactPath.t.sol

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,15 @@ contract GetArtifactPathTest is DSTest {
1313
DummyForGetArtifactPath dummy = new DummyForGetArtifactPath();
1414
bytes memory dummyCreationCode = type(DummyForGetArtifactPath).creationCode;
1515

16-
string memory root = vm.projectRoot();
1716
string memory path = vm.getArtifactPathByCode(dummyCreationCode);
18-
19-
string memory expectedPath =
20-
string.concat(root, "/out/default/GetArtifactPath.t.sol/DummyForGetArtifactPath.json");
21-
22-
assertEq(path, expectedPath);
17+
assertTrue(vm.contains(path, "/out/default/GetArtifactPath.t.sol/DummyForGetArtifactPath.json"));
2318
}
2419

2520
function testGetArtifactPathByDeployedCode() public {
2621
DummyForGetArtifactPath dummy = new DummyForGetArtifactPath();
2722
bytes memory dummyRuntimeCode = address(dummy).code;
2823

29-
string memory root = vm.projectRoot();
3024
string memory path = vm.getArtifactPathByDeployedCode(dummyRuntimeCode);
31-
32-
string memory expectedPath =
33-
string.concat(root, "/out/default/GetArtifactPath.t.sol/DummyForGetArtifactPath.json");
34-
35-
assertEq(path, expectedPath);
25+
assertTrue(vm.contains(path, "/out/default/GetArtifactPath.t.sol/DummyForGetArtifactPath.json"));
3626
}
3727
}

0 commit comments

Comments
 (0)