Skip to content

Commit

Permalink
Add a couple tests for multiline strings with empty lines (#607)
Browse files Browse the repository at this point in the history
  • Loading branch information
max-sixty authored Sep 22, 2024
1 parent c235d63 commit 8baf9a3
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions insta/src/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1065,3 +1065,31 @@ fn test_ownership() {
assert_debug_snapshot!(r, @"0..10");
assert_debug_snapshot!(r, @"0..10");
}

#[test]
fn test_empty_lines() {
assert_snapshot!(r#"single line should fit on a single line"#, @"single line should fit on a single line");
assert_snapshot!(r#"single line should fit on a single line, even if it's really really really really really really really really really long"#, @"single line should fit on a single line, even if it's really really really really really really really really really long");

assert_snapshot!(r#"multiline content starting on first line
final line
"#, @r###"
multiline content starting on first line
final line
"###);

assert_snapshot!(r#"
multiline content starting on second line
final line
"#, @r###"
multiline content starting on second line
final line
"###);
}

0 comments on commit 8baf9a3

Please sign in to comment.