Move Various str tests in library
This commit is contained in:
parent
c3364780d2
commit
7d834c87d2
@ -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