diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-09 15:19:14 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-09 15:19:14 +0100 |
commit | f1d084fbd9504497aed24b907b03247bfcd31675 (patch) | |
tree | 2e4d75008c01531075bced1596ec65047d74ca91 /crates/expect/src | |
parent | 6132111f87a6891db28ce37909607034c228f7a9 (diff) | |
parent | 65d9966a4f6c35b63f97c16f5f62f83a04574f3e (diff) |
Merge #5282
5282: Move diagnostics tests to expect r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/expect/src')
-rw-r--r-- | crates/expect/src/lib.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/expect/src/lib.rs b/crates/expect/src/lib.rs index c54e99203..21a458d47 100644 --- a/crates/expect/src/lib.rs +++ b/crates/expect/src/lib.rs | |||
@@ -121,6 +121,10 @@ impl ExpectFile { | |||
121 | } | 121 | } |
122 | Runtime::fail_file(self, &expected, actual); | 122 | Runtime::fail_file(self, &expected, actual); |
123 | } | 123 | } |
124 | pub fn assert_debug_eq(&self, actual: &impl fmt::Debug) { | ||
125 | let actual = format!("{:#?}\n", actual); | ||
126 | self.assert_eq(&actual) | ||
127 | } | ||
124 | fn read(&self) -> String { | 128 | fn read(&self) -> String { |
125 | fs::read_to_string(self.abs_path()).unwrap_or_default().replace("\r\n", "\n") | 129 | fs::read_to_string(self.abs_path()).unwrap_or_default().replace("\r\n", "\n") |
126 | } | 130 | } |