Skip to content

Commit 24b8936

Browse files
committed
Remove normalized_lines_match, it is not needed.
1 parent 6dff997 commit 24b8936

File tree

2 files changed

+5
-23
lines changed

2 files changed

+5
-23
lines changed

crates/cargo-test-support/src/compare.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -512,13 +512,6 @@ pub fn lines_match(expected: &str, mut actual: &str) -> bool {
512512
actual.is_empty() || expected.ends_with("[..]")
513513
}
514514

515-
/// Variant of `lines_match` that applies normalization to the strings.
516-
pub fn normalized_lines_match(expected: &str, actual: &str, cwd: Option<&Path>) -> bool {
517-
let expected = normalize_expected(expected, cwd);
518-
let actual = normalize_actual(actual, cwd);
519-
lines_match(&expected, &actual)
520-
}
521-
522515
/// Compares JSON object for approximate equality.
523516
/// You can use `[..]` wildcard in strings (useful for OS-dependent things such
524517
/// as paths). You can use a `"{...}"` string literal as a wildcard for

tests/testsuite/config.rs

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use cargo::util::config::{self, Config, SslVersionConfig, StringList};
55
use cargo::util::interning::InternedString;
66
use cargo::util::toml::{self, VecStringOrBool as VSOB};
77
use cargo::CargoResult;
8-
use cargo_test_support::compare::normalized_lines_match;
9-
use cargo_test_support::{paths, project, t};
8+
use cargo_test_support::compare;
9+
use cargo_test_support::{panic_error, paths, project, t};
1010
use serde::Deserialize;
1111
use std::borrow::Borrow;
1212
use std::collections::{BTreeMap, HashMap};
@@ -210,11 +210,8 @@ pub fn assert_error<E: Borrow<anyhow::Error>>(error: E, msgs: &str) {
210210

211211
#[track_caller]
212212
pub fn assert_match(expected: &str, actual: &str) {
213-
if !normalized_lines_match(expected, actual, None) {
214-
panic!(
215-
"Did not find expected:\n{}\nActual:\n{}\n",
216-
expected, actual
217-
);
213+
if let Err(e) = compare::match_exact(expected, actual, "output", "", None) {
214+
panic_error("", e);
218215
}
219216
}
220217

@@ -277,15 +274,7 @@ f1 = 1
277274

278275
// It should NOT have warned for the symlink.
279276
let output = read_output(config);
280-
let unexpected = "\
281-
warning: Both `[..]/.cargo/config` and `[..]/.cargo/config.toml` exist. Using `[..]/.cargo/config`
282-
";
283-
if normalized_lines_match(unexpected, &output, None) {
284-
panic!(
285-
"Found unexpected:\n{}\nActual error:\n{}\n",
286-
unexpected, output
287-
);
288-
}
277+
assert_eq!(output, "");
289278
}
290279

291280
#[cargo_test]

0 commit comments

Comments
 (0)