From 8b3b3182bd080df31080e4b8f30955ce2192f879 Mon Sep 17 00:00:00 2001 From: GrayJack Date: Thu, 2 Jul 2020 11:03:08 -0300 Subject: [PATCH] Add tests to check janet_table_remove behaviour --- src/boot/table_test.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/boot/table_test.c b/src/boot/table_test.c index 91c14144..ec59293c 100644 --- a/src/boot/table_test.c +++ b/src/boot/table_test.c @@ -61,5 +61,11 @@ int table_test() { assert(janet_equals(janet_table_get(t2, janet_csymbolv("t2key1")), janet_wrap_integer(10))); assert(janet_equals(janet_table_get(t2, janet_csymbolv("t2key2")), janet_wrap_integer(100))); + assert(t2->count == 4); + assert(janet_equals(janet_table_remove(t2, janet_csymbolv("t2key1")), janet_wrap_integer(10))); + assert(t2->count == 3); + assert(janet_equals(janet_table_remove(t2, janet_csymbolv("t2key2")), janet_wrap_integer(100))); + assert(t2->count == 2); + return 0; }