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 332fc64
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ Temporary Items
# Generated by Cargo
# will have compiled files and executables
/target/
/tests/sample-project/target/
/tests/fresh-prefix/.hidden/hidden-project/target

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Expand Down Expand Up @@ -112,5 +110,3 @@ tags
[._]*.un~

# End of https://www.gitignore.io/api/vim,rust,emacs,macos


1 change: 1 addition & 0 deletions tests/fresh-prefix/.hidden/hidden-project/target/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

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(())
}
1 change: 1 addition & 0 deletions tests/nested-root-workspace/target/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions tests/sample-project/target/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

0 comments on commit 332fc64

Please sign in to comment.