aboutsummaryrefslogtreecommitdiff
path: root/crates/expect
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-06-27 19:45:59 +0100
committerAleksey Kladov <[email protected]>2020-06-27 19:50:16 +0100
commit175e48e5be46faf6338d36907c6caf10c2d056f1 (patch)
tree067db71a4c875d38bbe28a534d13f629c6ab489d /crates/expect
parent18e4e9fb0ba2fa4e1f018b499d9b3c025cb2a51c (diff)
Remove fragile test
This test needs to be updated after every change (it contains line number), which is annoying. It also fails on windows due to \, so it's easier to remove it.
Diffstat (limited to 'crates/expect')
-rw-r--r--crates/expect/src/lib.rs31
1 files changed, 2 insertions, 29 deletions
diff --git a/crates/expect/src/lib.rs b/crates/expect/src/lib.rs
index 92364bfa7..dc4a4223e 100644
--- a/crates/expect/src/lib.rs
+++ b/crates/expect/src/lib.rs
@@ -78,7 +78,8 @@ impl Expect {
78 line_start += line.len(); 78 line_start += line.len();
79 } 79 }
80 let (literal_start, line_indent) = target_line.unwrap(); 80 let (literal_start, line_indent) = target_line.unwrap();
81 let literal_length = file[literal_start..].find("]]").expect("Couldn't find matching `]]` for `expect![[`."); 81 let literal_length =
82 file[literal_start..].find("]]").expect("Couldn't find matching `]]` for `expect![[`.");
82 let literal_range = literal_start..literal_start + literal_length; 83 let literal_range = literal_start..literal_start + literal_length;
83 Location { line_indent, literal_range } 84 Location { line_indent, literal_range }
84 } 85 }
@@ -239,34 +240,6 @@ mod tests {
239 use super::*; 240 use super::*;
240 241
241 #[test] 242 #[test]
242 fn test_expect_macro() {
243 let empty = expect![[]];
244 expect![[r#"
245 Expect {
246 file: "crates/expect/src/lib.rs",
247 line: 241,
248 column: 21,
249 data: "",
250 }
251 "#]]
252 .assert_debug_eq(&empty);
253
254 let expect = expect![["
255 hello
256 world
257 "]];
258 expect![[r#"
259 Expect {
260 file: "crates/expect/src/lib.rs",
261 line: 252,
262 column: 22,
263 data: "\n hello\n world\n ",
264 }
265 "#]]
266 .assert_debug_eq(&expect);
267 }
268
269 #[test]
270 fn test_format_patch() { 243 fn test_format_patch() {
271 let patch = format_patch(0, "hello\nworld\n"); 244 let patch = format_patch(0, "hello\nworld\n");
272 expect![[r##" 245 expect![[r##"