Skip to content

Commit dc983b8

Browse files
committed
two new test cases
1 parent be0bafa commit dc983b8

File tree

3 files changed

+179
-34
lines changed

3 files changed

+179
-34
lines changed

tests/common/mod.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ impl TestCase {
103103
assert!(!expected.is_empty(), "Missing expected fixture");
104104

105105
// munge actual and expected so that we don't rely on dates matching exactly
106-
munge_date(&mut expected, &mut actual);
107-
pretty_assertions::assert_eq!(expected, actual);
106+
munge_date(&mut actual, &mut expected);
107+
pretty_assertions::assert_eq!(actual, expected);
108108
}
109109
}
110110

@@ -113,14 +113,16 @@ pub(crate) fn fixture_path(relative_path: &str) -> PathBuf {
113113
directory.join("tests").join(relative_path)
114114
}
115115

116-
pub(crate) fn munge_date(expected: &mut String, actual: &mut String) {
116+
pub(crate) fn munge_date(actual: &mut String, expected: &mut String) {
117117
if let Some(i) = expected.find("{DATE}") {
118118
match actual.find("date: ") {
119119
Some(j) => {
120120
let eol = actual[j + 6..].find("\r\n").expect("missing eol");
121121
expected.replace_range(i..i + 6, &actual[j + 6..j + 6 + eol]);
122122
}
123-
None => expected.replace_range(i..i + 6, ""),
123+
None => {
124+
expected.replace_range(i..i + 6, "");
125+
}
124126
}
125127
}
126128
}

0 commit comments

Comments
 (0)