| 310 | } |
| 311 | |
| 312 | static 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 | |
| 329 | static void remove_all(void) |
| 330 | { |
no test coverage detected