Skip to content

Commit ce47fc6

Browse files
committed
Add tests for invalid date / display string start
1 parent 0d20201 commit ce47fc6

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/test_parser.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,13 @@ fn parse_date() -> Result<(), Error> {
867867
Ok(())
868868
}
869869

870+
#[test]
871+
#[should_panic]
872+
#[cfg(debug_assertions)]
873+
fn parse_invalid_date_start() {
874+
let _ = Parser::new("7").parse_date();
875+
}
876+
870877
#[test]
871878
#[cfg(feature = "parsed-types")]
872879
fn parse_display_string() -> Result<(), Error> {
@@ -925,3 +932,10 @@ fn parse_display_string_errors() {
925932
Err(Error::with_index("invalid UTF-8 in display string", 4))
926933
);
927934
}
935+
936+
#[test]
937+
#[should_panic]
938+
#[cfg(debug_assertions)]
939+
fn parse_invalid_display_string_start() {
940+
let _ = Parser::new(r#"""#).parse_display_string();
941+
}

0 commit comments

Comments
 (0)