add parse_string test
This commit is contained in:
parent
daab699f1f
commit
172275a5f6
@ -11,6 +11,16 @@ proptest! {
|
|||||||
fn doesnt_crash(s in "\\PC*") {
|
fn doesnt_crash(s in "\\PC*") {
|
||||||
let _output = json_object().parse(&s);
|
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]
|
#[test]
|
||||||
|
Loading…
Reference in New Issue
Block a user