Fix it! Accursed whitespace!
This commit is contained in:
parent
5ab5dd2e1b
commit
a2ecaef5ee
@ -154,6 +154,8 @@ impl JSON {
|
||||
result.insert(key, value);
|
||||
|
||||
initial = false;
|
||||
|
||||
self.skip_whitespace();
|
||||
}
|
||||
|
||||
// Move to the next character: '}'
|
||||
@ -509,6 +511,10 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn can_parse_arbitrary_json() {
|
||||
let result = JSON::parse(r#"[{ "a": 9.38083151965, "b": 4e3 }]"#);
|
||||
assert!(result.is_ok(), format!("Failed on just number values: {:#?}", result));
|
||||
|
||||
|
||||
let result = JSON::parse(
|
||||
r#"[{
|
||||
"a": 9.38083151965,
|
||||
@ -523,8 +529,7 @@ mod tests {
|
||||
}
|
||||
},
|
||||
"i": ["\"", "\\", "/", "\b", "\f", "\n", "\r", "\t", "\u0001", "\uface"]
|
||||
}]"#,
|
||||
);
|
||||
}]"#);
|
||||
assert!(result.is_ok(), format!("{:#?}", result));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user