We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c1a74a3 + 7d834c8 commit 3a4de42Copy full SHA for 3a4de42
library/alloc/tests/str.rs
@@ -1921,3 +1921,24 @@ fn different_str_pattern_forwarding_lifetimes() {
1921
1922
foo::<&str>("x");
1923
}
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
1935
+ assert_eq!(a, "this is a test".to_string());
1936
+ assert_eq!(b, "this is another test".to_string());
1937
+}
1938
1939
1940
+fn test_str_escapes() {
1941
+ let x = "\\\\\
1942
+ ";
1943
+ assert_eq!(x, r"\\"); // extraneous whitespace stripped
1944
src/test/ui/str-multiline.rs
src/test/ui/string-escapes.rs
0 commit comments