Selaa lähdekoodia

Test that errors outside the command itself are not errors

Mark Rousskov 6 vuotta sitten
vanhempi
commit
632cf2c43c
1 muutettua tiedostoa jossa 8 lisäystä ja 0 poistoa
  1. 8 0
      parser/src/command.rs

+ 8 - 0
parser/src/command.rs

@@ -79,6 +79,14 @@ impl<'a> Input<'a> {
     }
 }
 
+#[test]
+fn errors_outside_command_are_fine() {
+    let input =
+        "haha\" unterminated quotes @bot modify labels: +bug. Terminating after the command";
+    let mut input = Input::new(input, "bot");
+    assert!(input.parse_command().is_ok());
+}
+
 #[test]
 fn code_1() {
     let input = "`@bot modify labels: +bug.`";