Commit 866efadecbd94a437148c4c7fac2162f9a381d57

Baptiste 2024-08-01T16:07:40

correcting the bugs in ikc3_test

diff --git a/libkc3/buf_parse.c b/libkc3/buf_parse.c
index b1af68d..f9f526c 100644
--- a/libkc3/buf_parse.c
+++ b/libkc3/buf_parse.c
@@ -1082,13 +1082,13 @@ sw buf_parse_call_paren (s_buf *buf, s_call *dest)
 {
   sw r;
   sw result = 0;
-  s_call tmp;
+  s_call tmp = {0};
   s_buf_save save;
-  call_init_op_unary(&tmp);
   buf_save_init(buf, &save);
   if ((r = buf_read_1(buf, "(")) <= 0)
     goto restore;
   result += r;
+  call_init_op_unary(&tmp);
   ident_init_1(&tmp.ident, "()");
   if (! operator_resolve(&tmp.ident, 1, &tmp.ident)) {
     assert(! "buf_parse_call_paren: could not resolve operator ()");
@@ -1098,7 +1098,7 @@ sw buf_parse_call_paren (s_buf *buf, s_call *dest)
   if ((r = buf_ignore_spaces(buf)) < 0)
     goto restore;
   result += r;
-  if ((r = buf_parse_tag_primary(buf, &tmp.arguments->tag)) <= 0)
+  if ((r = buf_parse_tag(buf, &tmp.arguments->tag)) <= 0)
     goto restore;
   result += r;
   if ((r = buf_ignore_spaces(buf)) < 0)
@@ -3080,6 +3080,10 @@ sw buf_parse_quote (s_buf *buf, s_quote *dest)
     goto restore;
   }
   if ((r = buf_parse_tag(buf, quote.tag)) <= 0) {
+    err_puts("buf_parse_quote: buf_parse_tag");
+    err_inspect_buf(buf);
+    err_write_1("\n");
+    assert(! "buf_parse_quote: buf_parse_tag");
     free(quote.tag);
     goto restore;
   }
diff --git a/test/ikc3/call.kc3 b/test/ikc3/call.kc3
index b589450..ec18932 100644
--- a/test/ikc3/call.kc3
+++ b/test/ikc3/call.kc3
@@ -7,8 +7,5 @@ quote Test.test(1)
 quote Test.test(1, 2)
 quote Test.test(1, 2, 3)
 quote first([1, 2])
-first([1, 2])
 quote KC3.first([2, 3])
-KC3.first([2, 3])
 quote (1 + 2)
-(1 + 2)
diff --git a/test/ikc3/call.out.expected b/test/ikc3/call.out.expected
index 46fb3e1..9649141 100644
--- a/test/ikc3/call.out.expected
+++ b/test/ikc3/call.out.expected
@@ -7,8 +7,5 @@ Test.test((U8) 1)
 Test.test((U8) 1, (U8) 2)
 Test.test((U8) 1, (U8) 2, (U8) 3)
 first([(U8) 1, (U8) 2])
-(U8) 1
 first([(U8) 2, (U8) 3])
-(U8) 2
 ((U8) 1 + (U8) 2)
-(U8) 3
diff --git a/test/ikc3/current_test b/test/ikc3/current_test
new file mode 100644
index 0000000..e88e79e
--- /dev/null
+++ b/test/ikc3/current_test
@@ -0,0 +1 @@
+globals
diff --git a/test/ikc3_test b/test/ikc3_test
index 398ed72..ec45c93 100755
--- a/test/ikc3_test
+++ b/test/ikc3_test
@@ -44,6 +44,7 @@ touch .test .test_ko .test_ok
 for TARGET in $TARGETS; do
     (
         RESULT=test_ok
+        echo $TARGET > current_test
         $IKC3 --load ${TARGET}.kc3 --quit > ${TARGET}.out 2>&1
         echo $? > ${TARGET}.ret
         if ! diff -abu ${TARGET}.out.expected ${TARGET}.out \