Add another JSON test for an empty JSON

This commit is contained in:
Matthias Beyer 2017-06-20 20:42:01 +02:00
parent de3b244a62
commit e7e3a75924

View file

@ -153,6 +153,18 @@ mod test {
use super::*;
#[test]
fn test_empty_json_to_fs() {
let json = r#"{"version":"0.3.0","store":{}}"#;
let mut json = Cursor::new(String::from(json).into_bytes());
let mapper = JsonMapper::new();
let mut hm = HashMap::new();
let io_res = mapper.read_to_fs(&mut json, &mut hm);
assert!(io_res.is_ok());
assert!(hm.is_empty());
}
#[test]
fn test_json_to_fs() {
let json = r#"