Explorar o código

Test that errors outside the command itself are not errors

Mark Rousskov %!s(int64=6) %!d(string=hai) anos
pai
achega
632cf2c43c
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  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.`";