()
| 119 | |
| 120 | #[test] |
| 121 | fn it_should_parse_object() { |
| 122 | let value = parse_to_value( |
| 123 | r#"{ |
| 124 | "a": null, |
| 125 | "b": [null, "text"], |
| 126 | "c": true, |
| 127 | d: 25.55 |
| 128 | }"#, |
| 129 | &Default::default(), |
| 130 | ) |
| 131 | .unwrap() |
| 132 | .unwrap(); |
| 133 | |
| 134 | let mut object_map = Map::new(); |
| 135 | object_map.insert(String::from("a"), JsonValue::Null); |
| 136 | object_map.insert( |
| 137 | String::from("b"), |
| 138 | JsonValue::Array(vec![JsonValue::Null, JsonValue::String(Cow::Borrowed("text"))].into()), |
| 139 | ); |
| 140 | object_map.insert(String::from("c"), JsonValue::Boolean(true)); |
| 141 | object_map.insert(String::from("d"), JsonValue::Number("25.55")); |
| 142 | assert_eq!(value, JsonValue::Object(object_map.into())); |
| 143 | } |
| 144 | |
| 145 | #[test] |
| 146 | fn it_should_parse_boolean_false() { |
nothing calls this directly
no test coverage detected
searching dependent graphs…