| 265 | } |
| 266 | |
| 267 | static 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 | |
| 281 | static void remove_multiple(void) |
| 282 | { |
no test coverage detected