mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
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
This commit is contained in:
commit
3a4de42a8d
@ -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
|
||||
}
|
||||
|
@ -1,13 +0,0 @@
|
||||
// run-pass
|
||||
|
||||
pub fn main() {
|
||||
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());
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
// run-pass
|
||||
|
||||
fn main() {
|
||||
let x = "\\\\\
|
||||
";
|
||||
assert_eq!(x, r"\\"); // extraneous whitespace stripped
|
||||
}
|
Loading…
Reference in New Issue
Block a user