Skip to content

Commit

Permalink
fix: flip autodetect flag (#560)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Jan 24, 2022
1 parent 6be75fa commit 5b1e5e1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cli/src/cmd/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ impl Provider for BuildArgs {
}

if self.no_auto_detect {
dict.insert("auto_detect_solc".to_string(), self.no_auto_detect.into());
dict.insert("auto_detect_solc".to_string(), false.into());
}

if self.force {
Expand Down
15 changes: 15 additions & 0 deletions cli/tests/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,21 @@ forgetest_init!(can_override_config, |prj: TestProject, mut cmd: TestCommand| {
pretty_eq!(expected.trim().to_string(), cmd.stdout().trim().to_string());
});

forgetest_init!(can_detect_config_vals, |prj: TestProject, mut cmd: TestCommand| {
cmd.set_current_dir(prj.root());

let config = prj.config_from_output(["--no-auto-detect"]);
assert!(!config.auto_detect_solc);

let mut config = Config::load_with_root(prj.root());

config.auto_detect_solc = false;
// write to `foundry.toml`
prj.create_file(Config::FILE_NAME, &config.to_string_pretty().unwrap());
let config = prj.config_from_output(["--force"]);
assert!(!config.auto_detect_solc);
});

// checks that `clean` removes dapptools style paths
forgetest_init!(can_get_evm_opts, |prj: TestProject, mut cmd: TestCommand| {
cmd.set_current_dir(prj.root());
Expand Down

0 comments on commit 5b1e5e1

Please sign in to comment.