diff options
| author | Ralf Jung <post@ralfj.de> | 2020-09-16 08:24:54 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-16 08:24:54 +0200 |
| commit | 3a4de42a8d97043f99f9710a92d51208d41193a8 (patch) | |
| tree | 2c511f7c802b09a20ff335e85d550f9906ce3f1f /library/alloc/tests | |
| parent | c1a74a3c28e15d8697cf0bebd8fd1e60b7b0fba4 (diff) | |
| parent | 7d834c87d2ebb3d8dd4895bc5fabc4d44a1d2b52 (diff) | |
| download | rust-3a4de42a8d97043f99f9710a92d51208d41193a8.tar.gz rust-3a4de42a8d97043f99f9710a92d51208d41193a8.zip | |
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
Diffstat (limited to 'library/alloc/tests')
| -rw-r--r-- | library/alloc/tests/str.rs | 21 |
1 files changed, 21 insertions, 0 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 +} |
