We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 80dce98 + 156ff46 commit 417ec83Copy full SHA for 417ec83
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
0 commit comments