add parse_string test

This commit is contained in:
Greg Shuflin 2022-12-05 00:46:53 -08:00
parent daab699f1f
commit 172275a5f6
1 changed files with 10 additions and 0 deletions

View File

@ -11,6 +11,16 @@ proptest! {
fn doesnt_crash(s in "\\PC*") {
let _output = json_object().parse(&s);
}
#[test]
fn parse_string(s in r#"[^"]+"#) {
let input = format!("\"{}\"", s);
let output = json_string().parse(&input).unwrap();
match output {
(JsonValue::Str(output_s), "") if output_s == s => (),
_ => panic!(),
}
}
}
#[test]