diff --git a/lib/c3/0.1/c3.facts b/lib/c3/0.1/c3.facts
index dcc9f86..0bdbba9 100644
--- a/lib/c3/0.1/c3.facts
+++ b/lib/c3/0.1/c3.facts
@@ -173,7 +173,7 @@ replace {C3.operator23, :operator_associativity, :right}
replace {C3.break, :cfn, cfn Void "c3_break" ()}
replace {C3, :symbol, C3.first}
replace {C3.first, :fn, fn {
- ((a | _b)) { a }
+ ([a | _b]) { a }
({a, _b}) { a }
({a, _b, _c}) { a }
({a, _b, _c, _d}) { a }
@@ -182,3 +182,7 @@ add {C3, :symbol, C3.license}
replace {C3.license, :cfn, cfn Void "c3_license" ()}
add {C3, :symbol, C3.type}
replace {C3.type, :cfn, cfn Sym "tag_type" (Tag, Result)}
+add {C3, :symbol, C3.fib}
+replace {C3.fib, :fn, fn { (0) { 1 }
+ (1) { 1 }
+ (x) { fib(x - 1) + fib(x - 2) } }}
diff --git a/lib/c3/0.1/list.facts b/lib/c3/0.1/list.facts
index c3f5549..ea05f14 100644
--- a/lib/c3/0.1/list.facts
+++ b/lib/c3/0.1/list.facts
@@ -6,15 +6,15 @@ add {List, :symbol, List.map}
add {List, :symbol, List.reverse}
replace {List.cast, :cfn, cfn :list "list_cast" (:tag, :&result)}
replace {List.map, :fn, fn {
- ((), _) {
- ()
+ ([], _) {
+ []
}
- ((a | b), f) {
- (f(a) | List.map(b, f))
+ ([a | b], f) {
+ [f(a) | List.map(b, f)]
}
}}
replace {List.reverse, :fn, fn {
- (x) { List.reverse(x, ()) }
- ((), acc) { acc }
- ((a | b), acc) { List.reverse(b, (a | acc)) }
+ (x) { List.reverse(x, []) }
+ ([], acc) { acc }
+ ([a | b], acc) { List.reverse(b, [a | acc]) }
}}
diff --git a/libc3/buf_inspect.c b/libc3/buf_inspect.c
index e874407..a29743f 100644
--- a/libc3/buf_inspect.c
+++ b/libc3/buf_inspect.c
@@ -563,7 +563,6 @@ sw buf_inspect_paren_sym_size (const s_sym *sym)
sw buf_inspect_cfn (s_buf *buf, const s_cfn *cfn)
{
- s_list *arg_type;
sw r;
sw result = 0;
assert(cfn);
@@ -582,22 +581,7 @@ sw buf_inspect_cfn (s_buf *buf, const s_cfn *cfn)
if ((r = buf_write_1(buf, " ")) < 0)
return r;
result += r;
- if ((r = buf_write_1(buf, "(")) < 0)
- return r;
- result += r;
- arg_type = cfn->arg_types;
- while (arg_type) {
- if ((r = buf_inspect_tag(buf, &arg_type->tag)) < 0)
- return r;
- result += r;
- arg_type = list_next(arg_type);
- if (arg_type) {
- if ((r = buf_write_1(buf, ", ")) < 0)
- return r;
- result += r;
- }
- }
- if ((r = buf_write_1(buf, ")")) < 0)
+ if ((r = buf_inspect_list_paren(buf, (const s_list **) &cfn->arg_types)) < 0)
return r;
result += r;
return result;
@@ -1132,12 +1116,11 @@ sw buf_inspect_integer_size (const s_integer *x)
sw buf_inspect_list (s_buf *buf, const s_list **x)
{
- uw count = 0;
const s_list *i;
sw r;
sw result = 0;
assert(buf);
- if ((r = buf_write_u8(buf, '(')) <= 0)
+ if ((r = buf_write_1(buf, "[")) <= 0)
return r;
result++;
i = *x;
@@ -1145,7 +1128,6 @@ sw buf_inspect_list (s_buf *buf, const s_list **x)
if ((r = buf_inspect_tag(buf, &i->tag)) < 0)
return r;
result += r;
- count++;
switch (i->next.type) {
case TAG_LIST:
if (i->next.data.list) {
@@ -1154,11 +1136,45 @@ sw buf_inspect_list (s_buf *buf, const s_list **x)
result += r;
}
i = i->next.data.list;
- if (! i && count == 1) {
- if ((r = buf_write_1(buf, " | ()")) < 0)
+ continue;
+ default:
+ if ((r = buf_write_1(buf, " | ")) < 0)
+ return r;
+ result += r;
+ if ((r = buf_inspect_tag(buf, &i->next)) < 0)
+ return r;
+ result += r;
+ i = NULL;
+ }
+ }
+ if ((r = buf_write_1(buf, "]")) < 0)
+ return r;
+ result += r;
+ return result;
+}
+
+sw buf_inspect_list_paren (s_buf *buf, const s_list **x)
+{
+ const s_list *i;
+ sw r;
+ sw result = 0;
+ assert(buf);
+ if ((r = buf_write_1(buf, "(")) <= 0)
+ return r;
+ result++;
+ i = *x;
+ while (i) {
+ if ((r = buf_inspect_tag(buf, &i->tag)) < 0)
+ return r;
+ result += r;
+ switch (i->next.type) {
+ case TAG_LIST:
+ if (i->next.data.list) {
+ if ((r = buf_write_1(buf, ", ")) < 0)
return r;
result += r;
}
+ i = i->next.data.list;
continue;
default:
if ((r = buf_write_1(buf, " | ")) < 0)
@@ -1178,24 +1194,20 @@ sw buf_inspect_list (s_buf *buf, const s_list **x)
sw buf_inspect_list_size (const s_list **list)
{
- uw count = 0;
const s_list *i;
sw r;
sw result = 0;
- result += strlen("(");
+ result += strlen("[");
i = *list;
while (i) {
if ((r = buf_inspect_tag_size(&i->tag)) < 0)
return r;
result += r;
- count++;
switch (i->next.type) {
case TAG_LIST:
if (i->next.data.list)
result += strlen(", ");
i = i->next.data.list;
- if (! i && count == 1)
- result += strlen(" | ()");
continue;
default:
result += strlen(" | ");
@@ -1205,7 +1217,7 @@ sw buf_inspect_list_size (const s_list **list)
break;
}
}
- result += strlen(")");
+ result += strlen("]");
return result;
}
diff --git a/libc3/buf_inspect.h b/libc3/buf_inspect.h
index bbc3442..5fedd96 100644
--- a/libc3/buf_inspect.h
+++ b/libc3/buf_inspect.h
@@ -94,6 +94,7 @@ sw buf_inspect_ident_size (const s_ident *ident);
sw buf_inspect_integer (s_buf *buf, const s_integer *x);
sw buf_inspect_integer_size (const s_integer *x);
sw buf_inspect_list (s_buf *buf, const s_list **list);
+sw buf_inspect_list_paren (s_buf *buf, const s_list **list);
sw buf_inspect_list_size (const s_list **list);
sw buf_inspect_paren_sym (s_buf *buf, const s_sym *sym);
sw buf_inspect_paren_sym_size (const s_sym *sym);
diff --git a/libc3/buf_parse.c b/libc3/buf_parse.c
index 17a6d76..1c03c4e 100644
--- a/libc3/buf_parse.c
+++ b/libc3/buf_parse.c
@@ -868,7 +868,7 @@ sw buf_parse_cfn (s_buf *buf, s_cfn *dest)
if ((r = buf_ignore_spaces(buf)) <= 0)
goto restore;
result += r;
- if ((r = buf_parse_list(buf, &arg_types)) <= 0)
+ if ((r = buf_parse_list_paren(buf, &arg_types)) <= 0)
goto restore;
result += r;
cfn_init(&tmp, name_sym, arg_types, result_type);
@@ -1670,6 +1670,98 @@ sw buf_parse_list (s_buf *buf, s_list **list)
s_buf_save save;
buf_save_init(buf, &save);
i = list;
+ if ((r = buf_read_1(buf, "[")) <= 0)
+ goto clean;
+ result += r;
+ if ((r = buf_parse_comments(buf)) < 0)
+ goto restore;
+ result += r;
+ if ((r = buf_ignore_spaces(buf)) < 0)
+ goto restore;
+ result += r;
+ if ((r = buf_read_1(buf, "]")) < 0)
+ goto restore;
+ if (r > 0) {
+ result += r;
+ *list = NULL;
+ r = result;
+ goto clean;
+ }
+ *i = NULL;
+ while (1) {
+ *i = list_new(NULL, NULL);
+ if ((r = buf_parse_tag(buf, &(*i)->tag)) <= 0)
+ goto restore;
+ result += r;
+ if ((r = buf_parse_comments(buf)) < 0)
+ goto restore;
+ result += r;
+ if ((r = buf_ignore_spaces(buf)) < 0)
+ goto restore;
+ result += r;
+ if ((r = buf_read_1(buf, "]")) < 0)
+ goto restore;
+ if (r > 0) {
+ result += r;
+ r = result;
+ goto clean;
+ }
+ if ((r = buf_read_1(buf, ",")) < 0)
+ goto restore;
+ if (r > 0) {
+ result += r;
+ i = &(*i)->next.data.list;
+ if ((r = buf_parse_comments(buf)) < 0)
+ goto restore;
+ result += r;
+ if ((r = buf_ignore_spaces(buf)) < 0)
+ goto restore;
+ result += r;
+ continue;
+ }
+ if ((r = buf_read_1(buf, "|")) < 0)
+ goto restore;
+ if (r > 0) {
+ result += r;
+ if ((r = buf_parse_comments(buf)) < 0)
+ goto restore;
+ result += r;
+ if ((r = buf_ignore_spaces(buf)) < 0)
+ goto restore;
+ result += r;
+ if ((r = buf_parse_tag(buf, &(*i)->next)) <= 0)
+ goto restore;
+ result += r;
+ if ((r = buf_parse_comments(buf)) < 0)
+ goto restore;
+ result += r;
+ if ((r = buf_ignore_spaces(buf)) < 0)
+ goto restore;
+ result += r;
+ if ((r = buf_read_1(buf, "]")) <= 0)
+ goto restore;
+ result += r;
+ r = result;
+ goto clean;
+ }
+ goto restore;
+ }
+ restore:
+ list_delete_all(*list);
+ buf_save_restore_rpos(buf, &save);
+ clean:
+ buf_save_clean(buf, &save);
+ return r;
+}
+
+sw buf_parse_list_paren (s_buf *buf, s_list **list)
+{
+ s_list **i;
+ sw r;
+ sw result = 0;
+ s_buf_save save;
+ buf_save_init(buf, &save);
+ i = list;
if ((r = buf_read_1(buf, "(")) <= 0)
goto clean;
result += r;
diff --git a/libc3/buf_parse.h b/libc3/buf_parse.h
index 1d943f4..7f6a0cc 100644
--- a/libc3/buf_parse.h
+++ b/libc3/buf_parse.h
@@ -78,6 +78,7 @@ sw buf_parse_ident (s_buf *buf, s_ident *dest);
sw buf_parse_ident_peek (s_buf *buf, s_ident *dest);
sw buf_parse_integer (s_buf *buf, s_integer *dest);
sw buf_parse_list (s_buf *buf, s_list **dest);
+sw buf_parse_list_paren (s_buf *buf, s_list **dest);
sw buf_parse_module_name (s_buf *buf, const s_sym **dest);
sw buf_parse_new_tag (s_buf *buf, s_tag **dest);
sw buf_parse_paren_sym (s_buf *buf, const s_sym **dest);
diff --git a/libc3/env.c b/libc3/env.c
index a9141cf..8dc3822 100644
--- a/libc3/env.c
+++ b/libc3/env.c
@@ -423,7 +423,6 @@ bool env_eval_equal_tag (s_env *env, const s_tag *a, const s_tag *b,
case TAG_U64:
case TAG_UW:
if (compare_tag(a, b)) {
- warnx("env_eval_equal_tag: numeric value mismatch");
return false;
}
tag_copy(a, dest);
@@ -435,7 +434,6 @@ bool env_eval_equal_tag (s_env *env, const s_tag *a, const s_tag *b,
break;
}
if (a->type != b->type) {
- warnx("env_eval_equal_tag: type mismatch");
return false;
}
switch (a->type) {
diff --git a/libc3/file.c b/libc3/file.c
index 97b2c90..a2ad847 100644
--- a/libc3/file.c
+++ b/libc3/file.c
@@ -31,7 +31,7 @@ int file_copy (const char *from, const char *to)
warn("cp: %s", from);
return -1;
}
- if ((fd_to = open(to, O_WRONLY | O_CREAT | O_EXCL, 0666)) < 0) {
+ if ((fd_to = open(to, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) {
warn("cp: %s", to);
goto error;
}
diff --git a/test/buf_inspect_test.c b/test/buf_inspect_test.c
index f941da9..c89c5a9 100644
--- a/test/buf_inspect_test.c
+++ b/test/buf_inspect_test.c
@@ -294,7 +294,9 @@ TEST_CASE_END(buf_inspect_integer)
TEST_CASE(buf_inspect_list)
{
- BUF_INSPECT_TEST_LIST("()", "()");
+ BUF_INSPECT_TEST_LIST("[]", "[]");
+ BUF_INSPECT_TEST_LIST("[[], []]", "[[], []]");
+ BUF_INSPECT_TEST_LIST("[[] | []]", "[[]]");
}
TEST_CASE_END(buf_inspect_list)
@@ -390,9 +392,9 @@ TEST_CASE(buf_inspect_tag)
BUF_INSPECT_TEST_TAG(tag_ident_1(&tag, "ident"), "ident");
BUF_INSPECT_TEST_TAG(tag_integer_1(&tag, "-0x10000000000000000"), "-18446744073709551616");
BUF_INSPECT_TEST_TAG(tag_integer_1(&tag, "0x10000000000000000"), "18446744073709551616");
- BUF_INSPECT_TEST_TAG(tag_list(&tag, NULL), "()");
- BUF_INSPECT_TEST_TAG(tag_list_1(&tag, "(() | ())"), "(() | ())");
- BUF_INSPECT_TEST_TAG(tag_list_1(&tag, "()"), "()");
+ BUF_INSPECT_TEST_TAG(tag_list(&tag, NULL), "[]");
+ BUF_INSPECT_TEST_TAG(tag_list_1(&tag, "[[] | []]"), "[[]]");
+ BUF_INSPECT_TEST_TAG(tag_list_1(&tag, "[]"), "[]");
BUF_INSPECT_TEST_TAG(tag_s16(&tag, -0x100), "-256");
BUF_INSPECT_TEST_TAG(tag_s32(&tag, -0x10000), "-65536");
BUF_INSPECT_TEST_TAG(tag_s64(&tag, -0x100000000), "-4294967296");
diff --git a/test/buf_parse_test.c b/test/buf_parse_test.c
index f5741ae..939b229 100644
--- a/test/buf_parse_test.c
+++ b/test/buf_parse_test.c
@@ -996,7 +996,7 @@ TEST_CASE_END(buf_parse_digit_dec)
TEST_CASE(buf_parse_fn)
{
- BUF_PARSE_TEST_FN("fn () { () }");
+ BUF_PARSE_TEST_FN("fn () { [] }");
BUF_PARSE_TEST_FN("fn (x) { x }");
BUF_PARSE_TEST_FN("fn (x, y) { x }");
}
@@ -1159,14 +1159,14 @@ TEST_CASE_END(buf_parse_integer_bin)
TEST_CASE(buf_parse_list)
{
- BUF_PARSE_TEST_LIST("()");
- BUF_PARSE_TEST_LIST("((), ())");
- BUF_PARSE_TEST_LIST("(() | ())");
- BUF_PARSE_TEST_LIST("((), (), ())");
- BUF_PARSE_TEST_LIST("((), () | ())");
- BUF_PARSE_TEST_LIST("(a | b)");
- BUF_PARSE_TEST_LIST("(a, b | c)");
- BUF_PARSE_TEST_LIST("(a, b, c | d)");
+ BUF_PARSE_TEST_LIST("[]");
+ BUF_PARSE_TEST_LIST("[[], []]");
+ BUF_PARSE_TEST_LIST("[[] | []]");
+ BUF_PARSE_TEST_LIST("[[], [], []]");
+ BUF_PARSE_TEST_LIST("[[], [] | []]");
+ BUF_PARSE_TEST_LIST("[a | b]");
+ BUF_PARSE_TEST_LIST("[a, b | c]");
+ BUF_PARSE_TEST_LIST("[a, b, c | d]");
}
TEST_CASE_END(buf_parse_list)
@@ -1326,7 +1326,7 @@ TEST_CASE(buf_parse_tag)
{
BUF_PARSE_TEST_TAG("x");
BUF_PARSE_TEST_TAG("_x");
- BUF_PARSE_TEST_TAG("(x | _y)");
+ BUF_PARSE_TEST_TAG("[x | _y]");
}
TEST_CASE_END(buf_parse_tag)
diff --git a/test/compare_test.c b/test/compare_test.c
index 902a7f2..ac6e338 100644
--- a/test/compare_test.c
+++ b/test/compare_test.c
@@ -140,8 +140,8 @@ TEST_CASE_END(compare_f64)
TEST_CASE(compare_list)
{
COMPARE_TEST_LIST(NULL, NULL, 0);
- COMPARE_TEST_LIST(list_1("(A, B)"), list_1("(A, C)"), -1);
- COMPARE_TEST_LIST(list_1("(A, C)"), list_1("(A, B)"), 1);
+ COMPARE_TEST_LIST(list_1("[A, B]"), list_1("[A, C]"), -1);
+ COMPARE_TEST_LIST(list_1("[A, C]"), list_1("[A, B]"), 1);
}
TEST_CASE_END(compare_list)
diff --git a/test/env_test.c b/test/env_test.c
index 90a0f69..fbe2221 100644
--- a/test/env_test.c
+++ b/test/env_test.c
@@ -44,7 +44,7 @@ TEST_CASE(env_eval_call)
call_init(&call);
call.ident.module = sym_1("C3");
call.ident.sym = sym_1("operator08");
- call.arguments = list_1("(1, 2)");
+ call.arguments = list_1("[1, 2]");
tag_init_u8(&expected, 3);
TEST_ASSERT(env_eval_call(&env, &call, &result));
TEST_EQ(compare_tag(&result, &expected), 0);
@@ -75,9 +75,9 @@ TEST_CASE(env_eval_equal_tag)
env_clean(&env);
env_init(&env);
env.frame = frame_init(&frame, env.frame);
- test_context("x = (1, 2)");
+ test_context("x = (1, 2]");
TEST_ASSERT(env_eval_equal_tag(&env, tag_init_1(&x, "x"),
- tag_init_1(&y, "(1, 2)"), &z));
+ tag_init_1(&y, "[1, 2]"), &z));
TEST_ASSERT(frame_get(&frame, sym_1("x")));
TEST_EQ(compare_tag(&z, &y), 0);
tag_clean(&z);
@@ -85,18 +85,18 @@ TEST_CASE(env_eval_equal_tag)
env_clean(&env);
env_init(&env);
env.frame = frame_init(&frame, env.frame);
- test_context("() = ()");
- TEST_ASSERT(env_eval_equal_tag(&env, tag_1(&x, "()"),
- tag_1(&y, "()"), &z));
+ test_context("[] = []");
+ TEST_ASSERT(env_eval_equal_tag(&env, tag_1(&x, "[]"),
+ tag_1(&y, "[]"), &z));
TEST_EQ(compare_tag(&z, &y), 0);
tag_clean(&z);
env.frame = frame_clean(&frame);
env_clean(&env);
env_init(&env);
env.frame = frame_init(&frame, env.frame);
- test_context("(a, b) = (1, 2)");
- TEST_ASSERT(env_eval_equal_tag(&env, tag_1(&x, "(a, b)"),
- tag_1(&y, "(1, 2)"), &z));
+ test_context("[a, b] = [1, 2]");
+ TEST_ASSERT(env_eval_equal_tag(&env, tag_1(&x, "[a, b]"),
+ tag_1(&y, "[1, 2]"), &z));
TEST_ASSERT(frame_get(&frame, sym_1("a")));
TEST_ASSERT(frame_get(&frame, sym_1("b")));
TEST_EQ(compare_tag(&z, &y), 0);
@@ -105,9 +105,9 @@ TEST_CASE(env_eval_equal_tag)
env_clean(&env);
env_init(&env);
env.frame = frame_init(&frame, env.frame);
- test_context("x = (1, 2)");
- TEST_ASSERT(env_eval_equal_tag(&env, tag_1(&x, "(a | b)"),
- tag_1(&y, "(1, 2)"), &z));
+ test_context("x = [1, 2]");
+ TEST_ASSERT(env_eval_equal_tag(&env, tag_1(&x, "[a | b]"),
+ tag_1(&y, "[1, 2]"), &z));
TEST_ASSERT(frame_get(&frame, sym_1("a")));
TEST_ASSERT(frame_get(&frame, sym_1("b")));
TEST_EQ(compare_tag(&z, &y), 0);
@@ -144,8 +144,6 @@ TEST_CASE(env_init_clean)
{
s_env env;
env_init(&env);
- test_ok();
env_clean(&env);
- test_ok();
}
TEST_CASE_END(env_init_clean)
diff --git a/test/fact_test.h b/test/fact_test.h
index 32cbd79..1001316 100644
--- a/test/fact_test.h
+++ b/test/fact_test.h
@@ -22,12 +22,12 @@
fact_expected = (expected); \
fact_test = (test); \
if (compare_fact(fact_test, fact_expected) == 0) { \
- test_ok(); \
+ g_test_assert_count++; \
+ g_test_assert_ok++; \
} \
else { \
s_str str_expected; \
s_str str_test; \
- test_ko(); \
fact_inspect(fact_expected, &str_expected); \
fact_inspect(fact_test, &str_test); \
printf("\n%sAssertion failed in %s:%d %s\n" \
@@ -40,6 +40,7 @@
TEST_COLOR_RESET); \
str_clean(&str_expected); \
str_clean(&str_test); \
+ test_ko(); \
} \
} while (0)
diff --git a/test/facts_cursor_test.c b/test/facts_cursor_test.c
index 5c8170e..5c6c12f 100644
--- a/test/facts_cursor_test.c
+++ b/test/facts_cursor_test.c
@@ -42,8 +42,8 @@ TEST_CASE(facts_cursor_init)
":a",
"A",
"a",
- "()",
- "((), ())",
+ "[]",
+ "[[], []]",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -127,8 +127,8 @@ TEST_CASE(facts_cursor_next)
"0x10000",
"0x100000000",
"0x10000000000000000",
- "()",
- "((), ())",
+ "[]",
+ "[[], []]",
"\"a\"",
"A",
":a",
diff --git a/test/facts_test.c b/test/facts_test.c
index 131f4db..74796c9 100644
--- a/test/facts_test.c
+++ b/test/facts_test.c
@@ -56,8 +56,8 @@ TEST_CASE(facts_add)
":a",
"A",
"a",
- "()",
- "((), ())",
+ "[]",
+ "[[], []]",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -110,8 +110,8 @@ TEST_CASE(facts_dump_file)
":a",
"A",
"a",
- "()",
- "((), ())",
+ "[]",
+ "[[], []]",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -161,8 +161,8 @@ TEST_CASE(facts_find)
":a",
"A",
"a",
- "()",
- "((), ())",
+ "[]",
+ "[[], []]",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -215,13 +215,11 @@ TEST_CASE(facts_init_clean)
TEST_EQ(facts.facts.count, 0);
TEST_EQ(facts.log, NULL);
facts_clean(&facts);
- test_ok();
TEST_EQ(facts_init(&facts), &facts);
TEST_EQ(facts.tags.count, 0);
TEST_EQ(facts.facts.count, 0);
TEST_EQ(facts.log, NULL);
facts_clean(&facts);
- test_ok();
}
TEST_CASE_END(facts_init_clean)
@@ -233,8 +231,8 @@ TEST_CASE(facts_load)
":a",
"A",
"a",
- "()",
- "((), ())",
+ "[]",
+ "[[], []]",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -279,8 +277,8 @@ TEST_CASE(facts_log_add)
":a",
"A",
"a",
- "()",
- "((), ())",
+ "[]",
+ "[[], []]",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -330,8 +328,8 @@ TEST_CASE(facts_log_remove)
":a",
"A",
"a",
- "()",
- "((), ())",
+ "[]",
+ "[[], []]",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -399,8 +397,8 @@ TEST_CASE(facts_open_file)
":a",
"A",
"a",
- "()",
- "((), ())",
+ "[]",
+ "[[], []]",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -425,8 +423,8 @@ TEST_CASE(facts_open_file)
":b",
"B",
"b",
- "(() | ())",
- "((() | ()), ())",
+ "[[]]",
+ "[[[]], []]",
"{:b, :b}",
"{{:b, :b}, {:c, :d}}",
"{b, b}",
@@ -545,8 +543,8 @@ TEST_CASE(facts_remove)
":a",
"A",
"a",
- "()",
- "((), ())",
+ "[]",
+ "[[], []]",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -595,8 +593,8 @@ TEST_CASE(facts_save)
":a",
"A",
"a",
- "()",
- "((), ())",
+ "[]",
+ "[[], []]",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
diff --git a/test/facts_test_dump_file.expected.facts b/test/facts_test_dump_file.expected.facts
index 4d3a9e9..a49fe23 100644
--- a/test/facts_test_dump_file.expected.facts
+++ b/test/facts_test_dump_file.expected.facts
@@ -13,8 +13,8 @@ add {256, 256, 256}
add {65536, 65536, 65536}
add {4294967296, 4294967296, 4294967296}
add {18446744073709551616, 18446744073709551616, 18446744073709551616}
-add {(), (), ()}
-add {((), ()), ((), ()), ((), ())}
+add {[], [], []}
+add {[[], []], [[], []], [[], []]}
add {"a", "a", "a"}
add {A, A, A}
add {:a, :a, :a}
diff --git a/test/facts_test_load_file.facts b/test/facts_test_load_file.facts
index cd38dd2..2ea637c 100644
--- a/test/facts_test_load_file.facts
+++ b/test/facts_test_load_file.facts
@@ -14,8 +14,8 @@ add {10, 10, 10}
add {256, 256, 256}
add {65536, 65536, 65536}
add {4294967296, 4294967296, 4294967296}
-add {(), (), ()}
-add {((), ()), ((), ()), ((), ())}
+add {[], [], []}
+add {[[], []], [[], []], [[], []]}
add {"a", "a", "a"}
add {A, A, A}
add {:a, :a, :a}
diff --git a/test/facts_test_log_add.expected.facts b/test/facts_test_log_add.expected.facts
index 7f1260b..5286f7a 100644
--- a/test/facts_test_log_add.expected.facts
+++ b/test/facts_test_log_add.expected.facts
@@ -2,8 +2,8 @@ add {"a", "a", "a"}
add {:a, :a, :a}
add {A, A, A}
add {a, a, a}
-add {(), (), ()}
-add {((), ()), ((), ()), ((), ())}
+add {[], [], []}
+add {[[], []], [[], []], [[], []]}
add {{:a, :b}, {:a, :b}, {:a, :b}}
add {{{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}}
add {{a, b}, {a, b}, {a, b}}
diff --git a/test/facts_test_log_remove.expected.facts b/test/facts_test_log_remove.expected.facts
index 57fb991..f96c838 100644
--- a/test/facts_test_log_remove.expected.facts
+++ b/test/facts_test_log_remove.expected.facts
@@ -2,8 +2,8 @@ add {"a", "a", "a"}
add {:a, :a, :a}
add {A, A, A}
add {a, a, a}
-add {(), (), ()}
-add {((), ()), ((), ()), ((), ())}
+add {[], [], []}
+add {[[], []], [[], []], [[], []]}
add {{:a, :b}, {:a, :b}, {:a, :b}}
add {{{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}}
add {{a, b}, {a, b}, {a, b}}
@@ -38,8 +38,8 @@ remove {{{a, b}, {c, d}}, {{a, b}, {c, d}}, {{a, b}, {c, d}}}
remove {{a, b}, {a, b}, {a, b}}
remove {{{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}}
remove {{:a, :b}, {:a, :b}, {:a, :b}}
-remove {((), ()), ((), ()), ((), ())}
-remove {(), (), ()}
+remove {[[], []], [[], []], [[], []]}
+remove {[], [], []}
remove {a, a, a}
remove {A, A, A}
remove {:a, :a, :a}
diff --git a/test/facts_test_open_file.1.expected.facts b/test/facts_test_open_file.1.expected.facts
index 0c95440..61a8b67 100644
--- a/test/facts_test_open_file.1.expected.facts
+++ b/test/facts_test_open_file.1.expected.facts
@@ -14,8 +14,8 @@ add {10, 10, 10}
add {256, 256, 256}
add {65536, 65536, 65536}
add {4294967296, 4294967296, 4294967296}
-add {(), (), ()}
-add {((), ()), ((), ()), ((), ())}
+add {[], [], []}
+add {[[], []], [[], []], [[], []]}
add {"a", "a", "a"}
add {A, A, A}
add {:a, :a, :a}
@@ -27,8 +27,8 @@ remove {"a", "a", "a"}
remove {:a, :a, :a}
remove {A, A, A}
remove {a, a, a}
-remove {(), (), ()}
-remove {((), ()), ((), ()), ((), ())}
+remove {[], [], []}
+remove {[[], []], [[], []], [[], []]}
remove {{:a, :b}, {:a, :b}, {:a, :b}}
remove {{{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}}
remove {{a, b}, {a, b}, {a, b}}
@@ -50,8 +50,8 @@ add {"b", "b", "b"}
add {:b, :b, :b}
add {B, B, B}
add {b, b, b}
-add {(() | ()), (() | ()), (() | ())}
-add {((() | ()), ()), ((() | ()), ()), ((() | ()), ())}
+add {[[]], [[]], [[]]}
+add {[[[]], []], [[[]], []], [[[]], []]}
add {{:b, :b}, {:b, :b}, {:b, :b}}
add {{{:b, :b}, {:c, :d}}, {{:b, :b}, {:c, :d}}, {{:b, :b}, {:c, :d}}}
add {{b, b}, {b, b}, {b, b}}
diff --git a/test/facts_test_open_file.1.in.facts b/test/facts_test_open_file.1.in.facts
index cd38dd2..2ea637c 100644
--- a/test/facts_test_open_file.1.in.facts
+++ b/test/facts_test_open_file.1.in.facts
@@ -14,8 +14,8 @@ add {10, 10, 10}
add {256, 256, 256}
add {65536, 65536, 65536}
add {4294967296, 4294967296, 4294967296}
-add {(), (), ()}
-add {((), ()), ((), ()), ((), ())}
+add {[], [], []}
+add {[[], []], [[], []], [[], []]}
add {"a", "a", "a"}
add {A, A, A}
add {:a, :a, :a}
diff --git a/test/facts_test_open_file.2.expected.facts b/test/facts_test_open_file.2.expected.facts
index e49f9ef..637ad54 100644
--- a/test/facts_test_open_file.2.expected.facts
+++ b/test/facts_test_open_file.2.expected.facts
@@ -14,8 +14,8 @@ add {10, 10, 10}
add {256, 256, 256}
add {65536, 65536, 65536}
add {4294967296, 4294967296, 4294967296}
-add {(), (), ()}
-add {((), ()), ((), ()), ((), ())}
+add {[], [], []}
+add {[[], []], [[], []], [[], []]}
add {"a", "a", "a"}
add {A, A, A}
add {:a, :a, :a}
@@ -37,8 +37,8 @@ add {11, 11, 11}
add {257, 257, 257}
add {65537, 65537, 65537}
add {4294967297, 4294967297, 4294967297}
-add {(() | ()), (() | ()), (() | ())}
-add {((() | ()), ()), ((() | ()), ()), ((() | ()), ())}
+add {[[] | []], [[] | []], [[] | []]}
+add {[[[] | []], []], [[[] | []], []], [[[] | []], []]}
add {"b", "b", "b"}
add {B, B, B}
add {:b, :b, :b}
diff --git a/test/facts_test_open_file.2.in.facts b/test/facts_test_open_file.2.in.facts
index e49f9ef..637ad54 100644
--- a/test/facts_test_open_file.2.in.facts
+++ b/test/facts_test_open_file.2.in.facts
@@ -14,8 +14,8 @@ add {10, 10, 10}
add {256, 256, 256}
add {65536, 65536, 65536}
add {4294967296, 4294967296, 4294967296}
-add {(), (), ()}
-add {((), ()), ((), ()), ((), ())}
+add {[], [], []}
+add {[[], []], [[], []], [[], []]}
add {"a", "a", "a"}
add {A, A, A}
add {:a, :a, :a}
@@ -37,8 +37,8 @@ add {11, 11, 11}
add {257, 257, 257}
add {65537, 65537, 65537}
add {4294967297, 4294967297, 4294967297}
-add {(() | ()), (() | ()), (() | ())}
-add {((() | ()), ()), ((() | ()), ()), ((() | ()), ())}
+add {[[] | []], [[] | []], [[] | []]}
+add {[[[] | []], []], [[[] | []], []], [[[] | []], []]}
add {"b", "b", "b"}
add {B, B, B}
add {:b, :b, :b}
diff --git a/test/facts_test_open_file.3.expected.facts b/test/facts_test_open_file.3.expected.facts
index 34357b8..e089a6d 100644
--- a/test/facts_test_open_file.3.expected.facts
+++ b/test/facts_test_open_file.3.expected.facts
@@ -14,8 +14,8 @@ add {10, 10, 10}
add {256, 256, 256}
add {65536, 65536, 65536}
add {4294967296, 4294967296, 4294967296}
-add {(), (), ()}
-add {((), ()), ((), ()), ((), ())}
+add {[], [], []}
+add {[[], []], [[], []], [[], []]}
add {"a", "a", "a"}
add {A, A, A}
add {:a, :a, :a}
@@ -37,8 +37,8 @@ remove {10, 10, 10}
remove {256, 256, 256}
remove {65536, 65536, 65536}
remove {4294967296, 4294967296, 4294967296}
-remove {(), (), ()}
-remove {((), ()), ((), ()), ((), ())}
+remove {[], [], []}
+remove {[[], []], [[], []], [[], []]}
remove {"a", "a", "a"}
remove {A, A, A}
remove {:a, :a, :a}
@@ -50,8 +50,8 @@ add {"a", "a", "a"}
add {:a, :a, :a}
add {A, A, A}
add {a, a, a}
-add {(), (), ()}
-add {((), ()), ((), ()), ((), ())}
+add {[], [], []}
+add {[[], []], [[], []], [[], []]}
add {{:a, :b}, {:a, :b}, {:a, :b}}
add {{{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}}
add {{a, b}, {a, b}, {a, b}}
@@ -73,8 +73,8 @@ add {"b", "b", "b"}
add {:b, :b, :b}
add {B, B, B}
add {b, b, b}
-add {(() | ()), (() | ()), (() | ())}
-add {((() | ()), ()), ((() | ()), ()), ((() | ()), ())}
+add {[[]], [[]], [[]]}
+add {[[[]], []], [[[]], []], [[[]], []]}
add {{:b, :b}, {:b, :b}, {:b, :b}}
add {{{:b, :b}, {:c, :d}}, {{:b, :b}, {:c, :d}}, {{:b, :b}, {:c, :d}}}
add {{b, b}, {b, b}, {b, b}}
diff --git a/test/facts_test_open_file.3.in.facts b/test/facts_test_open_file.3.in.facts
index 6215c21..43cba38 100644
--- a/test/facts_test_open_file.3.in.facts
+++ b/test/facts_test_open_file.3.in.facts
@@ -14,8 +14,8 @@ add {10, 10, 10}
add {256, 256, 256}
add {65536, 65536, 65536}
add {4294967296, 4294967296, 4294967296}
-add {(), (), ()}
-add {((), ()), ((), ()), ((), ())}
+add {[], [], []}
+add {[[], []], [[], []], [[], []]}
add {"a", "a", "a"}
add {A, A, A}
add {:a, :a, :a}
@@ -37,8 +37,8 @@ remove {10, 10, 10}
remove {256, 256, 256}
remove {65536, 65536, 65536}
remove {4294967296, 4294967296, 4294967296}
-remove {(), (), ()}
-remove {((), ()), ((), ()), ((), ())}
+remove {[], [], []}
+remove {[[], []], [[], []], [[], []]}
remove {"a", "a", "a"}
remove {A, A, A}
remove {:a, :a, :a}
diff --git a/test/facts_test_save.expected.facts b/test/facts_test_save.expected.facts
index 4d3a9e9..a49fe23 100644
--- a/test/facts_test_save.expected.facts
+++ b/test/facts_test_save.expected.facts
@@ -13,8 +13,8 @@ add {256, 256, 256}
add {65536, 65536, 65536}
add {4294967296, 4294967296, 4294967296}
add {18446744073709551616, 18446744073709551616, 18446744073709551616}
-add {(), (), ()}
-add {((), ()), ((), ()), ((), ())}
+add {[], [], []}
+add {[[], []], [[], []], [[], []]}
add {"a", "a", "a"}
add {A, A, A}
add {:a, :a, :a}
diff --git a/test/fn_test.c b/test/fn_test.c
index cdc2ecc..6111948 100644
--- a/test/fn_test.c
+++ b/test/fn_test.c
@@ -36,6 +36,6 @@ TEST_CASE(fn_init_1)
FN_TEST_INIT_1("fn (x) { x * 2 }");
FN_TEST_INIT_1("fn (x, y) { x + y }");
FN_TEST_INIT_1("fn { (x) { x } (x, y) { x + y } }");
- FN_TEST_INIT_1("fn { (()) { :error } ((x | _y)) { x } (_) { :error } }");
+ FN_TEST_INIT_1("fn { ([]) { :error } ([x | _y]) { x } (_) { :error } }");
}
TEST_CASE_END(fn_init_1)
diff --git a/test/ic3/array.in b/test/ic3/array.in
index 31a73eb..017521d 100644
--- a/test/ic3/array.in
+++ b/test/ic3/array.in
@@ -107,8 +107,8 @@ l = (Integer) { 1000000000000000000000000000000001,
2000000000000000000000000000000002 }
l[0]
l[1]
-quote (List) {(1, 2), (3, 4)}
-(List) {(1, 2), (3, 4)}
-m = (List) {(1, 2), (3, 4)}
+quote (List) {[1, 2], [3, 4]}
+(List) {[1, 2], [3, 4]}
+m = (List) {[1, 2], [3, 4]}
m[0]
m[1]
diff --git a/test/ic3/array.out.expected b/test/ic3/array.out.expected
index a510d31..15365e8 100644
--- a/test/ic3/array.out.expected
+++ b/test/ic3/array.out.expected
@@ -93,8 +93,8 @@ d[1][1][1][1]
(Integer) {1000000000000000000000000000000001, 2000000000000000000000000000000002}
1000000000000000000000000000000001
2000000000000000000000000000000002
-(List) {(1, 2), (3, 4)}
-(List) {(1, 2), (3, 4)}
-(List) {(1, 2), (3, 4)}
-(1, 2)
-(3, 4)
+(List) {[1, 2], [3, 4]}
+(List) {[1, 2], [3, 4]}
+(List) {[1, 2], [3, 4]}
+[1, 2]
+[3, 4]
diff --git a/test/ic3/call.in b/test/ic3/call.in
index 427a171..e14bbc4 100644
--- a/test/ic3/call.in
+++ b/test/ic3/call.in
@@ -6,8 +6,8 @@ quote Test.test()
quote Test.test(1)
quote Test.test(1, 2)
quote Test.test(1, 2, 3)
-quote first((1, 2))
-quote C3.first((1, 2))
-first((1, 2))
-C3.first((2, 3))
+quote first([1, 2])
+quote C3.first([1, 2])
+first([1, 2])
+C3.first([2, 3])
(1 + 2)
diff --git a/test/ic3/call.out.expected b/test/ic3/call.out.expected
index b9a0bb3..b63c7c8 100644
--- a/test/ic3/call.out.expected
+++ b/test/ic3/call.out.expected
@@ -6,8 +6,8 @@ Test.test()
Test.test(1)
Test.test(1, 2)
Test.test(1, 2, 3)
-first((1, 2))
-C3.first((1, 2))
+first([1, 2])
+C3.first([1, 2])
1
2
3
diff --git a/test/ic3/equal.in b/test/ic3/equal.in
index dada6b5..34b3260 100644
--- a/test/ic3/equal.in
+++ b/test/ic3/equal.in
@@ -1,4 +1,4 @@
a = 1
b = 1
a = 2
-(a, b) = (1, 2)
+[a, b] = [1, 2]
diff --git a/test/ic3/equal.out.expected b/test/ic3/equal.out.expected
index b6d8518..c46aff7 100644
--- a/test/ic3/equal.out.expected
+++ b/test/ic3/equal.out.expected
@@ -1,4 +1,4 @@
1
1
2
-(1, 2)
+[1, 2]
diff --git a/test/ic3/fn.in b/test/ic3/fn.in
index 50eeeaa..f27a276 100644
--- a/test/ic3/fn.in
+++ b/test/ic3/fn.in
@@ -1,9 +1,9 @@
quote fn (x) { x }
quote fn (x, _y) { x }
-quote fn ((x | _y)) { x }
+quote fn ([x | _y]) { x }
quote fn {
- (()) { :error }
- ((x | _y)) { x }
+ ([]) { :error }
+ ([x | _y]) { x }
(_) { :error }
}
quote fn (x) {
@@ -14,14 +14,14 @@ a = fn (x) { x }
a(1)
b = fn (x, _y) { x }
b(1, 2)
-c = fn ((x | _y)) { x }
-c((1, 2))
+c = fn ([x | _y]) { x }
+c([1, 2])
d = fn {
- (()) { :error }
- ((x | _y)) { x }
+ ([]) { :error }
+ ([x | _y]) { x }
(_) { :error2 }
}
-d((1, 2))
+d([1, 2])
e = fn (x) {
"Hello, world !"
x * 2
diff --git a/test/ic3/fn.out.expected b/test/ic3/fn.out.expected
index 175d540..1b75d91 100644
--- a/test/ic3/fn.out.expected
+++ b/test/ic3/fn.out.expected
@@ -1,9 +1,9 @@
fn (x) { x }
fn (x, _y) { x }
-fn ((x | _y)) { x }
+fn ([x | _y]) { x }
fn {
- (()) { :error }
- ((x | _y)) { x }
+ ([]) { :error }
+ ([x | _y]) { x }
(_) { :error }
}
fn (x) {
@@ -14,11 +14,11 @@ fn (x) { x }
1
fn (x, _y) { x }
1
-fn ((x | _y)) { x }
+fn ([x | _y]) { x }
1
fn {
- (()) { :error }
- ((x | _y)) { x }
+ ([]) { :error }
+ ([x | _y]) { x }
(_) { :error2 }
}
1
diff --git a/test/ic3/list.in b/test/ic3/list.in
index d0852ec..492f08e 100644
--- a/test/ic3/list.in
+++ b/test/ic3/list.in
@@ -1,28 +1,28 @@
-()
-(() | ())
-((), ())
-((), (), ())
-((), (), (), ())
-((), () | ())
-((), (), () | ())
-(() | ((), ()))
-(() | ((), (), ()))
-(() | (() | ()))
-(() | ((), () | ()))
-(() | ((), (), () | ()))
-(((), ()) | ((), ()))
-((() | ()) | (() | ()))
-(:a | ())
-(:a, :b)
-(:a, :b, :c)
-(:a | :b)
-(:a, :b | :c)
-(:a, :b, :c, :d)
-(:a, :b, :c | :d)
+[]
+[[] | []]
+[[], []]
+[[], [], []]
+[[], [], [], []]
+[[], [] | []]
+[[], [], [] | []]
+[[] | [[], []]]
+[[] | [[], [], []]]
+[[] | [[] | []]]
+[[] | [[], [] | []]]
+[[] | [[], [], [] | []]]
+[[[], []] | [[], []]]
+[[[] | []] | [[] | []]]
+[:a | []]
+[:a, :b]
+[:a, :b, :c]
+[:a | :b]
+[:a, :b | :c]
+[:a, :b, :c, :d]
+[:a, :b, :c | :d]
# comment 0
# comment 0b
-( # comment 1
+[ # comment 1
# comment 1b
:a # comment 2
# comment 2b
@@ -38,9 +38,9 @@
## comment 7b
:d ## comment 8
## comment 8b
- ) ## comment 9
+ ] ## comment 9
## comment 9b
-List.map((1, 2, 3, 4), fn (x) { x * 2 })
+List.map([1, 2, 3, 4], fn (x) { x * 2 })
-List.reverse((1, 2, 3, 4))
+List.reverse([1, 2, 3, 4])
diff --git a/test/ic3/list.out.expected b/test/ic3/list.out.expected
index 6b61ae3..26dc4f7 100644
--- a/test/ic3/list.out.expected
+++ b/test/ic3/list.out.expected
@@ -1,24 +1,24 @@
-()
-(() | ())
-((), ())
-((), (), ())
-((), (), (), ())
-((), ())
-((), (), ())
-((), (), ())
-((), (), (), ())
-((), ())
-((), (), ())
-((), (), (), ())
-(((), ()), (), ())
-((() | ()), ())
-(:a | ())
-(:a, :b)
-(:a, :b, :c)
-(:a | :b)
-(:a, :b | :c)
-(:a, :b, :c, :d)
-(:a, :b, :c | :d)
-(:a, :b, :c | :d)
-(2, 4, 6, 8)
-(4, 3, 2, 1)
+[]
+[[]]
+[[], []]
+[[], [], []]
+[[], [], [], []]
+[[], []]
+[[], [], []]
+[[], [], []]
+[[], [], [], []]
+[[], []]
+[[], [], []]
+[[], [], [], []]
+[[[], []], [], []]
+[[[]], []]
+[:a]
+[:a, :b]
+[:a, :b, :c]
+[:a | :b]
+[:a, :b | :c]
+[:a, :b, :c, :d]
+[:a, :b, :c | :d]
+[:a, :b, :c | :d]
+[2, 4, 6, 8]
+[4, 3, 2, 1]
diff --git a/test/ic3/tuple.in b/test/ic3/tuple.in
index 116dce1..edb47f3 100644
--- a/test/ic3/tuple.in
+++ b/test/ic3/tuple.in
@@ -1,7 +1,7 @@
-{(), ()}
+{[], []}
{"", ""}
-{(), ""}
-{"", ()}
+{[], ""}
+{"", []}
{:a, :b}
{:a, :b, :c}
{:a, :b, :c, :d}
diff --git a/test/ic3/tuple.out.expected b/test/ic3/tuple.out.expected
index b8de9cc..755a2d1 100644
--- a/test/ic3/tuple.out.expected
+++ b/test/ic3/tuple.out.expected
@@ -1,7 +1,7 @@
-{(), ()}
+{[], []}
{"", ""}
-{(), ""}
-{"", ()}
+{[], ""}
+{"", []}
{:a, :b}
{:a, :b, :c}
{:a, :b, :c, :d}
diff --git a/test/list_test.c b/test/list_test.c
index eaac8f7..614df80 100644
--- a/test/list_test.c
+++ b/test/list_test.c
@@ -51,23 +51,23 @@ void list_test (void)
TEST_CASE(list_1)
{
- TEST_ASSERT(! list_1("()"));
- LIST_TEST_1("(() | ())");
- LIST_TEST_1("((), () | ())");
- LIST_TEST_1("((), (), () | ())");
- LIST_TEST_1("(A)");
- LIST_TEST_1("(A | B)");
- LIST_TEST_1("(A, B)");
- LIST_TEST_1("(A, B | C)");
- LIST_TEST_1("(A, B, C)");
- LIST_TEST_1("(A, B, C | D)");
+ TEST_ASSERT(! list_1("[]"));
+ LIST_TEST_1("[[] | []]");
+ LIST_TEST_1("[[], [] | []]");
+ LIST_TEST_1("[[], [], [] | []]");
+ LIST_TEST_1("[A]");
+ LIST_TEST_1("[A | B]");
+ LIST_TEST_1("[A, B]");
+ LIST_TEST_1("[A, B | C]");
+ LIST_TEST_1("[A, B, C]");
+ LIST_TEST_1("[A, B, C | D]");
}
TEST_CASE_END(list_1)
TEST_CASE(list_inspect)
{
- LIST_TEST_INSPECT("()", "()");
- LIST_TEST_INSPECT("(() | ())", "(() | ())");
- LIST_TEST_INSPECT("((), () | ())", "((), ())");
+ LIST_TEST_INSPECT("[]", "[]");
+ LIST_TEST_INSPECT("[[] | []]", "[[]]");
+ LIST_TEST_INSPECT("[[], [] | []]", "[[], []]");
}
TEST_CASE_END(list_inspect)
diff --git a/test/set__fact_test.c b/test/set__fact_test.c
index c03b89f..dc4142a 100644
--- a/test/set__fact_test.c
+++ b/test/set__fact_test.c
@@ -51,7 +51,6 @@
TEST_EQ(set.count, 0); \
TEST_EQ(set.max, max_); \
set_clean__fact(&set); \
- test_ok(); \
test_context(NULL); \
} while (0)
@@ -99,8 +98,8 @@ TEST_CASE(set__fact_add)
":a",
"A",
"a",
- "()",
- "((), ())",
+ "[]",
+ "[[], []]",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -147,8 +146,8 @@ TEST_CASE(set__fact_cursor)
":a",
"A",
"a",
- "()",
- "((), ())",
+ "[]",
+ "[[], []]",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -232,8 +231,8 @@ TEST_CASE(set__fact_remove)
":a",
"A",
"a",
- "()",
- "((), ())",
+ "[]",
+ "[[], []]",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -279,8 +278,8 @@ TEST_CASE(set__fact_resize)
":a",
"A",
"a",
- "()",
- "((), ())",
+ "[]",
+ "[[], []]",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
diff --git a/test/set__tag_test.c b/test/set__tag_test.c
index e6990b4..2619411 100644
--- a/test/set__tag_test.c
+++ b/test/set__tag_test.c
@@ -50,7 +50,6 @@
TEST_EQ(set.count, 0); \
TEST_EQ(set.max, max_); \
set_clean__tag(&set); \
- test_ok(); \
test_context(NULL); \
} while (0)
@@ -70,8 +69,8 @@
TEST_ASSERT(set_get__tag(&set, tag_1(&tag, ":a"))); \
TEST_ASSERT(set_get__tag(&set, tag_1(&tag, "A"))); \
TEST_ASSERT(set_get__tag(&set, tag_1(&tag, "a"))); \
- TEST_ASSERT(set_get__tag(&set, tag_1(&tag, "()"))); \
- TEST_ASSERT(set_get__tag(&set, tag_1(&tag, "((), ())"))); \
+ TEST_ASSERT(set_get__tag(&set, tag_1(&tag, "[]"))); \
+ TEST_ASSERT(set_get__tag(&set, tag_1(&tag, "[[], []]"))); \
TEST_ASSERT(set_get__tag(&set, tag_1(&tag, "{:a, :b}"))); \
TEST_ASSERT(set_get__tag(&set, tag_1(&tag, \
"{{:a, :b}, {:c, :d}}"))); \
@@ -126,8 +125,8 @@ TEST_CASE(set__tag_add)
"A.a(b, c)",
"B.a(b, c)",
"A.b(b, c)",
- "()",
- "((), ())",
+ "[]",
+ "[[], []]",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -176,9 +175,9 @@ TEST_CASE(set__tag_cursor)
SET__TAG_TEST_CURSOR(++i);
set_add__tag(&set, tag_1(&tag, "a"));
SET__TAG_TEST_CURSOR(++i);
- set_add__tag(&set, tag_1(&tag, "()"));
+ set_add__tag(&set, tag_1(&tag, "[]"));
SET__TAG_TEST_CURSOR(++i);
- set_add__tag(&set, tag_1(&tag, "((), ())"));
+ set_add__tag(&set, tag_1(&tag, "[[], []]"));
SET__TAG_TEST_CURSOR(++i);
set_add__tag(&set, tag_1(&tag, "{:a, :b}"));
SET__TAG_TEST_CURSOR(++i);
@@ -223,9 +222,9 @@ TEST_CASE(set__tag_cursor)
SET__TAG_TEST_CURSOR(--i);
set_remove__tag(&set, tag_1(&tag, "a"));
SET__TAG_TEST_CURSOR(--i);
- set_remove__tag(&set, tag_1(&tag, "()"));
+ set_remove__tag(&set, tag_1(&tag, "[]"));
SET__TAG_TEST_CURSOR(--i);
- set_remove__tag(&set, tag_1(&tag, "((), ())"));
+ set_remove__tag(&set, tag_1(&tag, "[[], []]"));
SET__TAG_TEST_CURSOR(--i);
set_remove__tag(&set, tag_1(&tag, "{:a, :b}"));
SET__TAG_TEST_CURSOR(--i);
@@ -312,8 +311,8 @@ TEST_CASE(set__tag_remove)
set_add__tag(&set, tag_1(&tag, ":a"));
set_add__tag(&set, tag_1(&tag, "A"));
set_add__tag(&set, tag_1(&tag, "a"));
- set_add__tag(&set, tag_1(&tag, "()"));
- set_add__tag(&set, tag_1(&tag, "((), ())"));
+ set_add__tag(&set, tag_1(&tag, "[]"));
+ set_add__tag(&set, tag_1(&tag, "[[], []]"));
set_add__tag(&set, tag_1(&tag, "{:a, :b}"));
set_add__tag(&set, tag_1(&tag, "{{:a, :b}, {:c, :d}}"));
set_add__tag(&set, tag_1(&tag, "{a, b}"));
@@ -340,10 +339,10 @@ TEST_CASE(set__tag_remove)
SET__TAG_TEST_REMOVE(tag_1(&tag, "A"), i);
SET__TAG_TEST_REMOVE(tag_1(&tag, "a"), --i);
SET__TAG_TEST_REMOVE(tag_1(&tag, "a"), i);
- SET__TAG_TEST_REMOVE(tag_1(&tag, "()"), --i);
- SET__TAG_TEST_REMOVE(tag_1(&tag, "()"), i);
- SET__TAG_TEST_REMOVE(tag_1(&tag, "((), ())"), --i);
- SET__TAG_TEST_REMOVE(tag_1(&tag, "((), ())"), i);
+ SET__TAG_TEST_REMOVE(tag_1(&tag, "[]"), --i);
+ SET__TAG_TEST_REMOVE(tag_1(&tag, "[]"), i);
+ SET__TAG_TEST_REMOVE(tag_1(&tag, "[[], []]"), --i);
+ SET__TAG_TEST_REMOVE(tag_1(&tag, "[[], []]"), i);
SET__TAG_TEST_REMOVE(tag_1(&tag, "{:a, :b}"), --i);
SET__TAG_TEST_REMOVE(tag_1(&tag, "{:a, :b}"), i);
SET__TAG_TEST_REMOVE(tag_1(&tag, "{{:a, :b}, {:c, :d}}"), --i);
@@ -396,10 +395,10 @@ TEST_CASE(set__tag_resize)
set_add__tag(&set, tag_1(&tag, "A"));
set_add__tag(&set, tag_1(&tag, "a"));
set_add__tag(&set, tag_1(&tag, "a"));
- set_add__tag(&set, tag_1(&tag, "()"));
- set_add__tag(&set, tag_1(&tag, "()"));
- set_add__tag(&set, tag_1(&tag, "((), ())"));
- set_add__tag(&set, tag_1(&tag, "((), ())"));
+ set_add__tag(&set, tag_1(&tag, "[]"));
+ set_add__tag(&set, tag_1(&tag, "[]"));
+ set_add__tag(&set, tag_1(&tag, "[[], []]"));
+ set_add__tag(&set, tag_1(&tag, "[[], []]"));
set_add__tag(&set, tag_1(&tag, "{:a, :b}"));
set_add__tag(&set, tag_1(&tag, "{:a, :b}"));
set_add__tag(&set, tag_1(&tag, "{{:a, :b}, {:c, :d}}"));
diff --git a/test/skiplist__fact_test.c b/test/skiplist__fact_test.c
index 96b064c..37a2484 100644
--- a/test/skiplist__fact_test.c
+++ b/test/skiplist__fact_test.c
@@ -38,7 +38,6 @@
TEST_EQ(skiplist->max_height, max_height_); \
TEST_EQ(skiplist->head->height, max_height_); \
skiplist_delete__fact(skiplist); \
- test_ok(); \
} while (0)
#define SKIPLIST__FACT_TEST_REMOVE(test, expected_length) \
@@ -75,8 +74,8 @@ TEST_CASE(skiplist__fact_find)
":a",
"A",
"a",
- "()",
- "((), ())",
+ "[]",
+ "[[], []]",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -133,8 +132,8 @@ TEST_CASE(skiplist__fact_insert)
":a",
"A",
"a",
- "()",
- "((), ())",
+ "[]",
+ "[[], []]",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -205,8 +204,8 @@ TEST_CASE(skiplist__fact_remove)
":a",
"A",
"a",
- "()",
- "((), ())",
+ "[]",
+ "[[], []]",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
diff --git a/test/tag_test.c b/test/tag_test.c
index 1127ea5..5419a5a 100644
--- a/test/tag_test.c
+++ b/test/tag_test.c
@@ -51,7 +51,7 @@ TEST_CASE_END(tag_hash_u64)
TEST_CASE(tag_init_1)
{
s_tag a;
- TEST_ASSERT(tag_init_1(&a, "fn () { () }"));
+ TEST_ASSERT(tag_init_1(&a, "fn () { [] }"));
tag_clean(&a);
TEST_ASSERT(tag_init_1(&a, "fn (x) { x }"));
tag_clean(&a);