]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/starts_ends_with.rs
Merge commit '57b3c4b90f4346b3990c1be387c3b3ca7b78412c' into clippyup
[rust.git] / tests / ui / starts_ends_with.rs
index e48a4246354391000da93003a6347b02bafbd0cc..e3335dd2e2ef7727f6e92500fbeebb4450a47164 100644 (file)
@@ -7,6 +7,10 @@ fn main() {}
 fn starts_with() {
     "".chars().next() == Some(' ');
     Some(' ') != "".chars().next();
+
+    // Ensure that suggestion is escaped correctly
+    "".chars().next() == Some('\n');
+    Some('\n') != "".chars().next();
 }
 
 fn chars_cmp_with_unwrap() {
@@ -31,7 +35,7 @@ fn chars_cmp_with_unwrap() {
         // !s.ends_with('o')
         // Nothing here
     }
-    if s.chars().last().unwrap() != 'o' {
+    if s.chars().last().unwrap() != '\n' {
         // !s.ends_with('o')
         // Nothing here
     }
@@ -43,4 +47,8 @@ fn ends_with() {
     Some(' ') != "".chars().last();
     "".chars().next_back() == Some(' ');
     Some(' ') != "".chars().next_back();
+
+    // Ensure that suggestion is escaped correctly
+    "".chars().last() == Some('\n');
+    Some('\n') != "".chars().last();
 }