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

Function remove_multiple

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

Source from the content-addressed store, hash-verified

310}
311
312static void remove_multiple(void)
313{
314 struct json *j = json_parse(tmpctx, "['a', 'b', 'c', 'd', 'e']");
315 json_tok_remove(&j->toks, j->toks, j->toks + 1, 2);
316 test_toks(j, "c", "d", "e", NULL);
317
318 j = json_parse(tmpctx, "['a', 'b', 'c', 'd', 'e']");
319 json_tok_remove(&j->toks, j->toks, j->toks + 2, 2);
320 test_toks(j, "a", "d", "e", NULL);
321
322 j = json_parse(tmpctx, "{'1':'one', '2':'two', '3':'three', '4':'four'}");
323 json_tok_remove(&j->toks, j->toks, j->toks + 3, 2);
324 assert(j);
325 test_toks(j, "1", "one", "4", "four", NULL);
326 assert(tal_count(j->toks) == 5);
327}
328
329static void remove_all(void)
330{

Callers 1

mainFunction · 0.85

Calls 3

json_tok_removeFunction · 0.85
test_toksFunction · 0.85
json_parseFunction · 0.70

Tested by

no test coverage detected