| 296 | } |
| 297 | |
| 298 | static 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 | |
| 312 | static void remove_multiple(void) |
| 313 | { |
no test coverage detected