From 5d44b522bb5aec46178981df99afa40edab120b6 Mon Sep 17 00:00:00 2001 From: Heng-Yi Wu <2316687+henry40408@users.noreply.github.com> Date: Wed, 19 Jun 2024 22:23:06 +0800 Subject: [PATCH] test: relax the assertion for compilation with OpenSSL in the testsuite version --- tests/testsuite/version.rs | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/tests/testsuite/version.rs b/tests/testsuite/version.rs index 7af63b998b7..b53f102d63f 100644 --- a/tests/testsuite/version.rs +++ b/tests/testsuite/version.rs @@ -1,30 +1,22 @@ //! Tests for displaying the cargo version. use cargo_test_support::{cargo_process, project, str}; +use snapbox::IntoData as _; #[cargo_test] fn simple() { let p = project().build(); p.cargo("version") - .with_stdout_data(str![[r#" -cargo [..] ([..] [..]) - -"#]]) + .with_stdout_data(&format!("cargo {}\n", cargo::version())) .run(); p.cargo("--version") - .with_stdout_data(str![[r#" -cargo [..] ([..] [..]) - -"#]]) + .with_stdout_data(&format!("cargo {}\n", cargo::version())) .run(); p.cargo("-V") - .with_stdout_data(str![[r#" -cargo [..] ([..] [..]) - -"#]]) + .with_stdout_data(&format!("cargo {}\n", cargo::version())) .run(); } @@ -60,7 +52,8 @@ fn version_works_with_bad_target_dir() { fn verbose() { // This is mainly to check that it doesn't explode. cargo_process("-vV") - .with_stdout_data(str![[r#" + .with_stdout_data( + str![[r#" cargo [..] ([..] [..]) release: [..] commit-hash: [..] @@ -68,8 +61,9 @@ commit-date: [..] host: [HOST_TARGET] libgit2: [..] (sys:[..] [..]) libcurl: [..] (sys:[..] [..]) -os: [..] - -"#]]) +... +"#]] + .unordered(), + ) .run(); }