Skip to content

Commit

Permalink
Rollup merge of #76369 - ayushmishra2005:move_various_str_tests_libra…
Browse files Browse the repository at this point in the history
…ry, r=jyn514

Move Various str tests in library

Moved various string ui  tests in library  as a part of #76268

r? @matklad
  • Loading branch information
RalfJung authored Sep 16, 2020
2 parents c1a74a3 + 7d834c8 commit 3a4de42
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
21 changes: 21 additions & 0 deletions library/alloc/tests/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1921,3 +1921,24 @@ fn different_str_pattern_forwarding_lifetimes() {

foo::<&str>("x");
}

#[test]
fn test_str_multiline() {
let a: String = "this \
is a test"
.to_string();
let b: String = "this \
is \
another \
test"
.to_string();
assert_eq!(a, "this is a test".to_string());
assert_eq!(b, "this is another test".to_string());
}

#[test]
fn test_str_escapes() {
let x = "\\\\\
";
assert_eq!(x, r"\\"); // extraneous whitespace stripped
}
13 changes: 0 additions & 13 deletions src/test/ui/str-multiline.rs

This file was deleted.

7 changes: 0 additions & 7 deletions src/test/ui/string-escapes.rs

This file was deleted.

0 comments on commit 3a4de42

Please sign in to comment.