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

Function remove_last

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

Source from the content-addressed store, hash-verified

296}
297
298static void remove_last(void)
299{
300 struct json *j = json_parse(tmpctx, "['one', 'two', 'three']");
301 json_tok_remove(&j->toks, j->toks, j->toks + 3, 1);
302 test_toks(j, "one", "two", NULL);
303 assert(tal_count(j->toks) == 3);
304
305 j = json_parse(tmpctx, "{'1':'one', '2':'two', '3':'three'}");
306 json_tok_remove(&j->toks, j->toks, j->toks + 5, 1);
307 assert(j);
308 test_toks(j, "1", "one", "2", "two", NULL);
309 assert(tal_count(j->toks) == 5);
310}
311
312static void remove_multiple(void)
313{

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