Skip to content

Commit

Permalink
Merge config.all during Config::merge.
Browse files Browse the repository at this point in the history
  • Loading branch information
azriel91 committed May 24, 2020
1 parent 5633f65 commit 30bbbd5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ impl Config {
self.target_dir = Config::pick_optional_config(&self.target_dir, &other.target_dir);
self.output_directory =
Config::pick_optional_config(&self.output_directory, &other.output_directory);
self.all |= other.all;

if !other.excluded_files_raw.is_empty() {
self.excluded_files_raw
Expand Down Expand Up @@ -652,6 +653,21 @@ mod tests {
assert_eq!(a.target, Some(String::from("x86_64-linux-gnu")));
}

#[test]
fn workspace_merge() {
let toml_a = r#"workspace = false"#;
let toml_b = r#"workspace = true"#;

let mut a: Config = toml::from_slice(toml_a.as_bytes()).unwrap();
let b: Config = toml::from_slice(toml_b.as_bytes()).unwrap();

assert_eq!(a.all, false);
assert_eq!(b.all, true);

a.merge(&b);
assert_eq!(a.all, true);
}

#[test]
fn coveralls_merge() {
let toml = r#"[a]
Expand Down

0 comments on commit 30bbbd5

Please sign in to comment.