MCPcopy Create free account
hub / github.com/dprint/jsonc-parser / it_should_parse_object

Function it_should_parse_object

src/parse_to_value.rs:121–143  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 3

parse_to_valueFunction · 0.85
ArrayClass · 0.85
insertMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…