MCPcopy Create free account
hub / github.com/ElementsProject/lightning / remove_inside_obj

Function remove_inside_obj

common/test/run-json_remove.c:352–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350}
351
352static void remove_inside_obj(void)
353{
354 jsmntok_t *tok;
355 struct json *j = json_parse(tmpctx,
356 "{'1':'one', '2':'two',"
357 "'3': { '3.1': 'a', '3.2':'b', '3.3':'c' }, "
358 "'4':'four'}");
359
360 tok = (jsmntok_t *)json_get_member(j->buffer, j->toks, "3");
361 json_tok_remove(&j->toks, tok, tok+1, 1);
362 test_toks(j, "1", "one", "2", "two", "3", "{", "3.2", "b", "3.3", "c",
363 "4", "four", NULL);
364}
365
366int main(int argc, char *argv[])
367{

Callers 1

mainFunction · 0.85

Calls 4

json_get_memberFunction · 0.85
json_tok_removeFunction · 0.85
test_toksFunction · 0.85
json_parseFunction · 0.70

Tested by

no test coverage detected