Procházet zdrojové kódy

Test that errors outside the command itself are not errors

Mark Rousskov před 6 roky
rodič
revize
632cf2c43c
1 změnil soubory, kde provedl 8 přidání a 0 odebrání
  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.`";