Skip to content

Commit

Permalink
chore: update test
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes committed Feb 22, 2024
1 parent df78c37 commit 81b35e6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 33 deletions.
31 changes: 7 additions & 24 deletions crates/forge/tests/cli/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,31 +536,10 @@ contract Greeter {
cmd.arg("build");

let output = cmd.stdout_lossy();
assert!(output.contains(
"
Compiler run successful with warnings:
Warning (5667): Warning: Unused function parameter. Remove or comment out the variable name to silence this warning.
",
));
assert!(output.contains("Warning"), "{output}");
});

// Tests that direct import paths are handled correctly
//
// NOTE(onbjerg): Disabled for Windows -- for some reason solc fails with a bogus error message
// here: error[9553]: TypeError: Invalid type for argument in function call. Invalid implicit
// conversion from struct Bar memory to struct Bar memory requested. --> src\Foo.sol:12:22:
// |
// 12 | FooLib.check(b);
// | ^
//
//
//
// error[9553]: TypeError: Invalid type for argument in function call. Invalid implicit conversion
// from contract Foo to contract Foo requested. --> src\Foo.sol:15:23:
// |
// 15 | FooLib.check2(this);
// | ^^^^
#[cfg(not(target_os = "windows"))]
forgetest!(can_handle_direct_imports_into_src, |prj, cmd| {
prj.add_source(
"Foo",
Expand Down Expand Up @@ -1572,8 +1551,12 @@ forgetest_init!(can_install_missing_deps_build, |prj, cmd| {
cmd.arg("build");

let output = cmd.stdout_lossy();
assert!(output.contains("Missing dependencies found. Installing now"), "{}", output);
assert!(output.contains("No files changed, compilation skipped"), "{}", output);
assert!(output.contains("Missing dependencies found. Installing now"), "{output}");

// re-run
let output = cmd.stdout_lossy();
assert!(!output.contains("Missing dependencies found. Installing now"), "{output}");
assert!(output.contains("No files changed, compilation skipped"), "{output}");
});

// checks that extra output works
Expand Down
9 changes: 2 additions & 7 deletions crates/forge/tests/cli/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ contract Foo {}
// test to ensure yul optimizer can be set as intended
forgetest!(can_set_yul_optimizer, |prj, cmd| {
prj.add_source(
"Foo",
"foo.sol",
r"
contract Foo {
function bar() public pure {
Expand All @@ -405,12 +405,7 @@ contract Foo {
..Default::default()
};
prj.write_config(config);

assert!(cmd.stdout_lossy().ends_with(
"
Compiler run successful!
",
));
cmd.assert_success();
});

// tests that the lib triple can be parsed
Expand Down
3 changes: 1 addition & 2 deletions crates/forge/tests/fixtures/can_set_yul_optimizer.stderr
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
Error:
Compiler run failed:
Error (6553): SyntaxError: The msize instruction cannot be used when the Yul optimizer is activated because it can change its semantics. Either disable the Yul optimizer or do not use the instruction.
Error (6553): The msize instruction cannot be used when the Yul optimizer is activated because it can change its semantics. Either disable the Yul optimizer or do not use the instruction.
--> src/Foo.sol:6:8:
|
6 | assembly {
| ^ (Relevant source part starts here and spans across multiple lines).


0 comments on commit 81b35e6

Please sign in to comment.