Skip to content

Commit

Permalink
test that toolchain lists only appear once
Browse files Browse the repository at this point in the history
  • Loading branch information
marcospb19 committed Feb 15, 2023
1 parent aacd5ef commit c62fc85
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,3 +453,24 @@ fn recursive_multiple_root_workspaces() -> TestResult {

Ok(())
}

#[test]
fn check_toolchain_listing_on_multiple_projects() -> TestResult {
let args = &["sweep", "--dry-run", "--recursive", "--installed"];
let assert = run(Command::new(cargo_bin("cargo-sweep"))
.args(args)
.current_dir("tests/"));

let stdout = std::str::from_utf8(&assert.get_output().stdout).unwrap();
let lines = stdout
.lines()
.filter(|line| line.starts_with("[INFO]"))
.collect::<Vec<_>>();

assert_eq!(lines.len(), 3);
assert!(lines[0].starts_with("[INFO] Using all installed toolchains:"));
assert!(lines[1].starts_with("[INFO] Would clean:"));
assert!(lines[2].starts_with("[INFO] Would clean:"));

Ok(())
}

0 comments on commit c62fc85

Please sign in to comment.