diff options
| author | Ayush Kumar Mishra <ayush.k.mishra@xcelenergy.com> | 2020-09-05 17:24:06 +0530 |
|---|---|---|
| committer | Ayush Kumar Mishra <ayush.k.mishra@xcelenergy.com> | 2020-09-05 17:24:06 +0530 |
| commit | 7d834c87d2ebb3d8dd4895bc5fabc4d44a1d2b52 (patch) | |
| tree | 917f521eeed801115d4744cef4c557a1ebbe923f | |
| parent | c3364780d2cfddfe329f62a3ec138fd4f9a60e27 (diff) | |
| download | rust-7d834c87d2ebb3d8dd4895bc5fabc4d44a1d2b52.tar.gz rust-7d834c87d2ebb3d8dd4895bc5fabc4d44a1d2b52.zip | |
Move Various str tests in library
| -rw-r--r-- | library/alloc/tests/str.rs | 21 | ||||
| -rw-r--r-- | src/test/ui/str-multiline.rs | 13 | ||||
| -rw-r--r-- | src/test/ui/string-escapes.rs | 7 |
3 files changed, 21 insertions, 20 deletions
diff --git a/library/alloc/tests/str.rs b/library/alloc/tests/str.rs index b20cf076aca..ed8ee2d8823 100644 --- a/library/alloc/tests/str.rs +++ b/library/alloc/tests/str.rs @@ -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 +} diff --git a/src/test/ui/str-multiline.rs b/src/test/ui/str-multiline.rs deleted file mode 100644 index 2b2e001d8bb..00000000000 --- a/src/test/ui/str-multiline.rs +++ /dev/null @@ -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()); -} diff --git a/src/test/ui/string-escapes.rs b/src/test/ui/string-escapes.rs deleted file mode 100644 index cee5e27786c..00000000000 --- a/src/test/ui/string-escapes.rs +++ /dev/null @@ -1,7 +0,0 @@ -// run-pass - -fn main() { - let x = "\\\\\ - "; - assert_eq!(x, r"\\"); // extraneous whitespace stripped -} |
