Skip to content

Commit

Permalink
tst
Browse files Browse the repository at this point in the history
  • Loading branch information
syphar committed Oct 13, 2024
1 parent ec61278 commit 3d8a660
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions tests/buildtest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ fn test_cargo_workspace() {
}

#[test]
fn test_capture_stderr() {
fn test_capture_stderr_yanked() {
runner::run("yanked-deps", |run| {
let res = run.run(
rustwide::cmd::SandboxBuilder::new().enable_networking(false),
Expand All @@ -180,32 +180,14 @@ fn test_capture_stderr() {
if let Some(rustwide::PrepareError::YankedDependencies(output)) =
res.err().and_then(|err| err.downcast().ok())
{
panic!("{}", output);
// Everything is OK!
assert!(output
.contains(r#"failed to select a version for the requirement `ring = "^0.2"`"#));
assert!(output.contains("candidate versions found which didn't match"));
} else {
panic!("didn't get the error {}", stringify!($expected));
}
Ok(())
});
// runner::run("yanked-deps", |run| {
// run.run(SandboxBuilder::new().enable_networking(false), |build| {
// Command::new(&run.workspace, run.toolchain.cargo())
// .cd(build.host_source_dir())
// .args(&["generate-lockfile"])
// .run()?;

// // match build.cargo().args(&["generate-lockfile"]).run_capture() {
// // Ok(_) => panic!("Expected an error"),
// // Err(CommandError::ExecutionFailed { status, stderr }) => {
// // assert_eq!(status.code(), Some(101));
// // assert!(stderr.contains("error: failed to parse manifest"));
// // }
// // Err(err) => panic!("expected CommandError::ExecutionFailed, got {:?}", err),
// // }
// Ok(())
// })?;
// Ok(())
// });
}

test_prepare_error!(
Expand Down

0 comments on commit 3d8a660

Please sign in to comment.