Skip to content

Commit 3a4de42

Browse files
authored
Rollup merge of #76369 - ayushmishra2005:move_various_str_tests_library, r=jyn514
Move Various str tests in library Moved various string ui tests in library as a part of #76268 r? @matklad
2 parents c1a74a3 + 7d834c8 commit 3a4de42

File tree

3 files changed

+21
-20
lines changed

3 files changed

+21
-20
lines changed

library/alloc/tests/str.rs

+21
Original file line numberDiff line numberDiff line change
@@ -1921,3 +1921,24 @@ fn different_str_pattern_forwarding_lifetimes() {
19211921

19221922
foo::<&str>("x");
19231923
}
1924+
1925+
#[test]
1926+
fn test_str_multiline() {
1927+
let a: String = "this \
1928+
is a test"
1929+
.to_string();
1930+
let b: String = "this \
1931+
is \
1932+
another \
1933+
test"
1934+
.to_string();
1935+
assert_eq!(a, "this is a test".to_string());
1936+
assert_eq!(b, "this is another test".to_string());
1937+
}
1938+
1939+
#[test]
1940+
fn test_str_escapes() {
1941+
let x = "\\\\\
1942+
";
1943+
assert_eq!(x, r"\\"); // extraneous whitespace stripped
1944+
}

src/test/ui/str-multiline.rs

-13
This file was deleted.

src/test/ui/string-escapes.rs

-7
This file was deleted.

0 commit comments

Comments
 (0)