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

Function remove_last

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

Source from the content-addressed store, hash-verified

265}
266
267static void remove_last(void)
268{
269 struct json *j = json_parse(tmpctx, "['one', 'two', 'three']");
270 json_tok_remove(&j->toks, j->toks, j->toks + 3, 1);
271 test_toks(j, "one", "two", NULL);
272 assert(tal_count(j->toks) == 3);
273
274 j = json_parse(tmpctx, "{'1':'one', '2':'two', '3':'three'}");
275 json_tok_remove(&j->toks, j->toks, j->toks + 5, 1);
276 assert(j);
277 test_toks(j, "1", "one", "2", "two", NULL);
278 assert(tal_count(j->toks) == 5);
279}
280
281static void remove_multiple(void)
282{

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