Skip to content

Commit

Permalink
fix unit tests on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
japaric authored May 29, 2020
1 parent 6774d0e commit 860590a
Showing 1 changed file with 6 additions and 21 deletions.
27 changes: 6 additions & 21 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,51 +292,36 @@ mod tests {
.path(Artifact::Bin("foo"), Profile::Dev, None, windows)
.unwrap();

assert!(p.to_str().unwrap().ends_with("target/debug/foo.exe"));
assert!(p.ends_with("target/debug/foo.exe"));

let p = project
.path(Artifact::Example("bar"), Profile::Dev, None, windows)
.unwrap();

assert!(p
.to_str()
.unwrap()
.ends_with("target/debug/examples/bar.exe"));
assert!(p.ends_with("target/debug/examples/bar.exe"));

let p = project
.path(Artifact::Bin("foo"), Profile::Dev, Some(thumb), windows)
.unwrap();

assert!(p
.to_str()
.unwrap()
.ends_with(&format!("target/{}/debug/foo", thumb)));
assert!(p.ends_with(&format!("target/{}/debug/foo", thumb)));

let p = project
.path(Artifact::Example("bar"), Profile::Dev, Some(thumb), windows)
.unwrap();

assert!(p
.to_str()
.unwrap()
.ends_with(&format!("target/{}/debug/examples/bar", thumb)));
assert!(p.ends_with(&format!("target/{}/debug/examples/bar", thumb)));

let p = project
.path(Artifact::Bin("foo"), Profile::Dev, Some(wasm), linux)
.unwrap();

assert!(p
.to_str()
.unwrap()
.ends_with(&format!("target/{}/debug/foo.wasm", wasm)));
assert!(p.ends_with(&format!("target/{}/debug/foo.wasm", wasm)));

let p = project
.path(Artifact::Example("bar"), Profile::Dev, Some(wasm), linux)
.unwrap();

assert!(p
.to_str()
.unwrap()
.ends_with(&format!("target/{}/debug/examples/bar.wasm", wasm)));
assert!(p.ends_with(&format!("target/{}/debug/examples/bar.wasm", wasm)));
}
}

0 comments on commit 860590a

Please sign in to comment.