diff --git a/lib/c3/0.1/c3.facts b/lib/c3/0.1/c3.facts
index 641aaf4..1496a9f 100644
--- a/lib/c3/0.1/c3.facts
+++ b/lib/c3/0.1/c3.facts
@@ -33,4 +33,4 @@
({a, _b, _c}) { a }
({a, _b, _c, _d}) { a }
}}
-%{hash: 0x375C2B0E1EE24CD3}
+%{hash: 0x092E75DE5883B150}
diff --git a/libc3/buf_parse.c b/libc3/buf_parse.c
index f5b8fb1..85e5690 100644
--- a/libc3/buf_parse.c
+++ b/libc3/buf_parse.c
@@ -504,7 +504,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_cfn_arg_types(buf, &arg_types)) <= 0)
+ if ((r = buf_parse_list(buf, &arg_types)) <= 0)
goto restore;
result += r;
cfn_init(&tmp, name_sym, arg_types, result_type);
@@ -1003,6 +1003,12 @@ sw buf_parse_fn_pattern (s_buf *buf, s_list **dest)
if ((r = buf_ignore_spaces(buf)) < 0)
goto restore;
result += r;
+ if ((r = buf_read_1(buf, ")")) < 0)
+ goto restore;
+ if (r) {
+ result += r;
+ goto ok;
+ }
while (1) {
if ((r = buf_parse_tag(buf, &tag)) <= 0)
goto restore;
@@ -1019,13 +1025,16 @@ sw buf_parse_fn_pattern (s_buf *buf, s_list **dest)
if (! r) {
if ((r = buf_read_1(buf, ")")) < 0)
goto restore;
- result += r;
- break;
+ if (r) {
+ result += r;
+ goto ok;
+ }
}
if ((r = buf_ignore_spaces(buf)) < 0)
goto restore;
result += r;
}
+ ok:
*dest = tmp;
r = result;
goto clean;
diff --git a/libc3/cfn.c b/libc3/cfn.c
index 7ef78a1..f431568 100644
--- a/libc3/cfn.c
+++ b/libc3/cfn.c
@@ -115,9 +115,12 @@ s_cfn * cfn_copy (const s_cfn *cfn, s_cfn *dest)
list_copy(cfn->arg_types, &dest->arg_types);
dest->arity = cfn->arity;
dest->cif = cfn->cif;
- dest->cif.arg_types = calloc(cfn->cif.nargs + 1, sizeof(ffi_type *));
- memcpy(dest->cif.arg_types, cfn->cif.arg_types,
- (cfn->cif.nargs + 1) * sizeof(ffi_type *));
+ if (cfn->arity) {
+ dest->cif.arg_types = calloc(cfn->cif.nargs + 1,
+ sizeof(ffi_type *));
+ memcpy(dest->cif.arg_types, cfn->cif.arg_types,
+ (cfn->cif.nargs + 1) * sizeof(ffi_type *));
+ }
dest->result_type = cfn->result_type;
dest->ptr = cfn->ptr;
return dest;
@@ -165,8 +168,11 @@ s_cfn * cfn_prep_cif (s_cfn *cfn)
return NULL;
}
if (cfn->arity) {
- if (! (arg_ffi_type = calloc(sizeof(ffi_type *), cfn->arity + 1)))
- err(1, "cfn_prep_cif");
+ if (! (arg_ffi_type = calloc(sizeof(ffi_type *), cfn->arity + 1))) {
+ assert(! "cfn_prep_cif: arg_ffi_type");
+ err(1, "cfn_prep_cif: arg_ffi_type");
+ return NULL;
+ }
a = cfn->arg_types;
while (a) {
assert(i < cfn->arity);
diff --git a/libc3/env.c b/libc3/env.c
index 595d58e..005afc5 100644
--- a/libc3/env.c
+++ b/libc3/env.c
@@ -526,7 +526,7 @@ s_module * env_module_load (s_env *env, s_module *module,
buf_write_s8(&env->out, '\n');
buf_flush(&env->out);
*/
- if (facts_load_file(facts, path.ptr.ps8) < 0) {
+ if (facts_load_file(facts, &path) < 0) {
str_clean(&path);
return 0;
}
diff --git a/libc3/facts.c b/libc3/facts.c
index 53435d3..ea88ecf 100644
--- a/libc3/facts.c
+++ b/libc3/facts.c
@@ -30,7 +30,7 @@
#include "skiplist__fact.h"
#include "tag.h"
-sw facts_open_file_create (s_facts *facts, const s8 *path);
+sw facts_open_file_create (s_facts *facts, const s_str *path);
sw facts_open_log (s_facts *facts, s_buf *buf);
s_fact * facts_add_fact (s_facts *facts, const s_fact *fact)
@@ -227,7 +227,7 @@ s_facts * facts_init (s_facts *facts)
return facts;
}
-sw facts_load (s_facts *facts, s_buf *buf)
+sw facts_load (s_facts *facts, s_buf *buf, const s_str *path)
{
u64 count;
s_fact_w fact;
@@ -285,28 +285,32 @@ sw facts_load (s_facts *facts, s_buf *buf)
buf_init_alloc(&tmp, 16);
buf_inspect_u64_hex(&tmp, hash_u64);
buf_write_s8(&tmp, 0);
- warnx("facts_load: invalid hash line %lu: 0x%s",
- (unsigned long) i + 4,
+ warnx("facts_load: %s: invalid hash line %lu: 0x%s",
+ path->ptr.ps8,
+ (unsigned long) i + 5,
tmp.ptr.ps8);
buf_clean(&tmp);
return -1;
}
return result;
ko_header:
- warnx("facts_load: invalid or missing header");
+ warnx("facts_load: %s: invalid or missing header",
+ path->ptr.ps8);
return -1;
ko_fact:
facts_lock_unlock_w(facts);
- warnx("facts_load: %s fact line %lu", r ? "invalid" : "missing",
- (unsigned long) i + 4);
+ warnx("facts_load: %s: %s fact line %lu", r ? "invalid" : "missing",
+ path->ptr.ps8,
+ (unsigned long) i + 5);
return -1;
ko_hash:
- warnx("facts_load: %s hash line %lu", r ? "invalid" : "missing",
- (unsigned long) i + 4);
+ warnx("facts_load: %s: %s hash line %lu", r ? "invalid" : "missing",
+ path->ptr.ps8,
+ (unsigned long) i + 5);
return -1;
}
-sw facts_load_file (s_facts *facts, const s8 *path)
+sw facts_load_file (s_facts *facts, const s_str *path)
{
s8 b[BUF_SIZE];
s_buf buf;
@@ -315,12 +319,12 @@ sw facts_load_file (s_facts *facts, const s8 *path)
assert(facts);
assert(path);
buf_init(&buf, false, sizeof(b), b);
- if (! (fp = fopen(path, "r"))) {
- warn("facts_load_file: %s", path);
+ if (! (fp = fopen(path->ptr.ps8, "r"))) {
+ warn("facts_load_file: %s", path->ptr.ps8);
return -1;
}
buf_file_open_r(&buf, fp);
- result = facts_load(facts, &buf);
+ result = facts_load(facts, &buf, path);
buf_file_close(&buf);
fclose(fp);
return result;
@@ -430,18 +434,19 @@ s_facts * facts_new ()
return facts_init(n);
}
-sw facts_open_buf (s_facts *facts, s_buf *buf)
+sw facts_open_buf (s_facts *facts, s_buf *buf, const s_str *path)
{
sw r;
sw result = 0;
if ((r = buf_read_1(buf,
"%{module: C3.Facts.Save,\n"
" version: 0x0000000000000001}\n")) <= 0) {
- warnx("facts_open_buf: invalid or missing header");
+ warnx("facts_open_buf: %s: invalid or missing header",
+ path->ptr.ps8);
return -1;
}
result += r;
- if ((r = facts_load(facts, buf)) <= 0)
+ if ((r = facts_load(facts, buf, path)) <= 0)
return r;
result += r;
if ((r = facts_open_log(facts, buf)) < 0)
@@ -450,7 +455,7 @@ sw facts_open_buf (s_facts *facts, s_buf *buf)
return result;
}
-sw facts_open_file (s_facts *facts, const s8 *path)
+sw facts_open_file (s_facts *facts, const s_str *path)
{
FILE *fp;
s8 i[BUF_SIZE];
@@ -458,18 +463,18 @@ sw facts_open_file (s_facts *facts, const s8 *path)
sw r;
sw result = 0;
buf_init(&in, false, sizeof(i), i);
- if (! (fp = fopen(path, "rb"))) {
+ if (! (fp = fopen(path->ptr.ps8, "rb"))) {
if (errno == ENOENT)
return facts_open_file_create(facts, path);
return -1;
}
buf_file_open_r(&in, fp);
- if ((r = facts_open_buf(facts, &in)) < 0)
+ if ((r = facts_open_buf(facts, &in, path)) < 0)
return r;
result += r;
buf_file_close(&in);
- if (! (fp = fopen(path, "ab"))) {
- warn("fopen: %s", path);
+ if (! (fp = fopen(path->ptr.ps8, "ab"))) {
+ warn("facts_open_file: fopen: %s", path->ptr.ps8);
return -1;
}
if (! (facts->log = log_new(BUF_SIZE)))
@@ -478,14 +483,14 @@ sw facts_open_file (s_facts *facts, const s8 *path)
return result;
}
-sw facts_open_file_create (s_facts *facts, const s8 *path)
+sw facts_open_file_create (s_facts *facts, const s_str *path)
{
FILE *fp;
s_buf *out;
sw r;
sw result = 0;
- if (! (fp = fopen(path, "wb"))) {
- warn("fopen: %s", path);
+ if (! (fp = fopen(path->ptr.ps8, "wb"))) {
+ warn("facts_open_file_create: fopen: %s", path->ptr.ps8);
return -1;
}
if (facts_count(facts)) {
diff --git a/libc3/facts.h b/libc3/facts.h
index 228237e..ed2bb76 100644
--- a/libc3/facts.h
+++ b/libc3/facts.h
@@ -35,15 +35,15 @@ s_fact * facts_add_tags (s_facts *facts, const s_tag *subject,
const s_tag *predicate,
const s_tag *object);
void facts_close (s_facts *facts);
-sw facts_load (s_facts *facts, s_buf *buf);
-sw facts_load_file (s_facts *facts, const s8 *path);
+sw facts_load (s_facts *facts, s_buf *buf, const s_str *path);
+sw facts_load_file (s_facts *facts, const s_str *path);
void facts_lock_clean (s_facts *facts);
void facts_lock_init (s_facts *facts);
void facts_lock_r (s_facts *facts);
void facts_lock_unlock_r (s_facts *facts);
void facts_lock_unlock_w (s_facts *facts);
void facts_lock_w (s_facts *facts);
-sw facts_open_file (s_facts *facts, const s8 *path);
+sw facts_open_file (s_facts *facts, const s_str *path);
s_tag * facts_ref_tag (s_facts *facts, const s_tag *tag);
e_bool facts_remove_fact (s_facts *facts, const s_fact *fact);
sw facts_save_file (s_facts *facts, const s8 *path);
diff --git a/libc3/sym.c b/libc3/sym.c
index 620a874..48e06f8 100644
--- a/libc3/sym.c
+++ b/libc3/sym.c
@@ -145,8 +145,6 @@ const s_sym * sym_new (const s_str *src)
ffi_type * sym_to_ffi_type (const s_sym *sym, ffi_type *result_type)
{
- if (sym == sym_1("tag"))
- return &ffi_type_pointer;
if (sym == sym_1("&result")) {
if (! result_type)
warnx("invalid result type: &result");
@@ -162,6 +160,8 @@ ffi_type * sym_to_ffi_type (const s_sym *sym, ffi_type *result_type)
return &ffi_type_sint64;
if (sym == sym_1("sw"))
return &ffi_type_sint;
+ if (sym == sym_1("tag"))
+ return &ffi_type_pointer;
if (sym == sym_1("u8"))
return &ffi_type_uint8;
if (sym == sym_1("u16"))
@@ -172,8 +172,10 @@ ffi_type * sym_to_ffi_type (const s_sym *sym, ffi_type *result_type)
return &ffi_type_uint64;
if (sym == sym_1("uw"))
return &ffi_type_uint;
+ if (sym == sym_1("void"))
+ return &ffi_type_void;
assert(! "sym_to_ffi_type: unknown type");
- errx(1, "sym_to_ffi_type: unknown type");
+ errx(1, "sym_to_ffi_type: unknown type: %s", sym->str.ptr.ps8);
return NULL;
}
diff --git a/libc3/sym.h b/libc3/sym.h
index 2747721..68920ef 100644
--- a/libc3/sym.h
+++ b/libc3/sym.h
@@ -49,6 +49,7 @@ e_bool sym_is_module (const s_sym *sym);
const s_sym * sym_new (const s_str *src);
ffi_type * sym_to_ffi_type (const s_sym *sym, ffi_type *result_type);
-bool sym_to_tag_type (const s_sym *sym, e_tag_type *dest);
+
+bool sym_to_tag_type (const s_sym *sym, e_tag_type *dest);
#endif /* SYM_H */
diff --git a/test/buf_inspect_test.c b/test/buf_inspect_test.c
index ce3f6c4..0bef72e 100644
--- a/test/buf_inspect_test.c
+++ b/test/buf_inspect_test.c
@@ -88,8 +88,10 @@
s_list *list_test; \
test_context("buf_inspect_list(" # test ") -> " # expected); \
buf_init_1(&buf_test, (test)); \
- if (buf_parse_list(&buf_test, &list_test) != strlen(test)) \
- errx(1, "buf_parse_list"); \
+ if (buf_parse_list(&buf_test, &list_test) != strlen(test)) { \
+ assert(! "BUF_INSPECT_TEST_LIST: buf_parse_list"); \
+ errx(1, "BUF_INSPECT_TEST_LIST: buf_parse_list"); \
+ } \
buf_init_alloc(&buf, 1024 * 1024); \
TEST_EQ(buf_inspect_list(&buf, list_test), strlen(expected)); \
TEST_EQ(buf.wpos, strlen(expected)); \
@@ -251,7 +253,7 @@ void buf_inspect_test_integer ()
void buf_inspect_test_list ()
{
- BUF_INSPECT_TEST_LIST("[]", "[]");
+ BUF_INSPECT_TEST_LIST("()", "()");
}
void buf_inspect_test_str ()
@@ -342,10 +344,10 @@ void buf_inspect_test_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_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_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 23ed50c..9eed050 100644
--- a/test/buf_parse_test.c
+++ b/test/buf_parse_test.c
@@ -904,7 +904,7 @@ void buf_parse_test_f64()
void buf_parse_test_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 }");
}
@@ -1060,14 +1060,14 @@ void buf_parse_test_integer_oct()
void buf_parse_test_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)");
}
void buf_parse_test_str ()
@@ -1215,7 +1215,7 @@ void buf_parse_test_tag ()
{
BUF_PARSE_TEST_TAG("x");
BUF_PARSE_TEST_TAG("_x");
- BUF_PARSE_TEST_TAG("[x | _y]");
+ BUF_PARSE_TEST_TAG("(x | _y)");
}
void buf_parse_test_tuple ()
diff --git a/test/compare_test.c b/test/compare_test.c
index 511e38a..b39215e 100644
--- a/test/compare_test.c
+++ b/test/compare_test.c
@@ -135,8 +135,8 @@ void compare_test_f64 ()
void compare_test_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);
}
void compare_test_str ()
diff --git a/test/env_test.c b/test/env_test.c
index 6a4595c..7d6666b 100644
--- a/test/env_test.c
+++ b/test/env_test.c
@@ -46,9 +46,9 @@ void env_test_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_1(&x, "x"),
- tag_1(&y, "[1, 2]"), &z));
+ tag_1(&y, "(1, 2)"), &z));
TEST_ASSERT(frame_get(&frame, x.data.ident.sym));
TEST_EQ(compare_tag(&z, &y), 0);
tag_clean(&z);
@@ -56,18 +56,18 @@ void env_test_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("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);
@@ -76,9 +76,9 @@ void env_test_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);
diff --git a/test/facts_cursor_test.c b/test/facts_cursor_test.c
index 7531ac0..f560907 100644
--- a/test/facts_cursor_test.c
+++ b/test/facts_cursor_test.c
@@ -42,8 +42,8 @@ void facts_cursor_test_init ()
":a",
"A",
"a",
- "[]",
- "[[], []]",
+ "()",
+ "((), ())",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -127,8 +127,8 @@ void facts_cursor_test_next ()
"0x100",
"0x10000",
"0x100000000",
- "[]",
- "[[], []]",
+ "()",
+ "((), ())",
"\"a\"",
"A",
":a",
diff --git a/test/facts_test.c b/test/facts_test.c
index 65ca5a8..fec9556 100644
--- a/test/facts_test.c
+++ b/test/facts_test.c
@@ -55,8 +55,8 @@ void facts_test_add ()
":a",
"A",
"a",
- "[]",
- "[[], []]",
+ "()",
+ "((), ())",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -108,8 +108,8 @@ void facts_test_dump_file ()
":a",
"A",
"a",
- "[]",
- "[[], []]",
+ "()",
+ "((), ())",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -158,8 +158,8 @@ void facts_test_find ()
":a",
"A",
"a",
- "[]",
- "[[], []]",
+ "()",
+ "((), ())",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -228,8 +228,8 @@ void facts_test_load ()
":a",
"A",
"a",
- "[]",
- "[[], []]",
+ "()",
+ "((), ())",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -251,10 +251,10 @@ void facts_test_load ()
};
s_fact fact;
s_facts facts;
+ s_str path;
facts_init(&facts);
- TEST_EQ(facts_load_file(&facts,
- "facts_test_load_file.facts"),
- 742);
+ str_init_1(&path, NULL, "facts_test_load_file.facts");
+ TEST_EQ(facts_load_file(&facts, &path), 742);
TEST_EQ(facts_count(&facts), 23);
while (p[i]) {
fact_test_init_1(&fact, p[i]);
@@ -273,8 +273,8 @@ void facts_test_log_add ()
":a",
"A",
"a",
- "[]",
- "[[], []]",
+ "()",
+ "((), ())",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -323,8 +323,8 @@ void facts_test_log_remove ()
":a",
"A",
"a",
- "[]",
- "[[], []]",
+ "()",
+ "((), ())",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -402,8 +402,8 @@ void facts_test_open_file ()
":a",
"A",
"a",
- "[]",
- "[[], []]",
+ "()",
+ "((), ())",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -428,8 +428,8 @@ void facts_test_open_file ()
":b",
"B",
"b",
- "[[]]",
- "[[[]], []]",
+ "(())",
+ "((()), ())",
"{:b, :b}",
"{{:b, :b}, {:c, :d}}",
"{b, b}",
@@ -452,14 +452,14 @@ void facts_test_open_file ()
sw r;
s_fact fact;
s_facts facts;
+ s_str path;
if ((r = system("cp facts_test_open_file.1.in.facts facts_test_open_file.1.facts")) < 0)
err(1, "%s:%i: cp", __FILE__, __LINE__);
if (r > 0)
errx(1, "%s:%i: cp", __FILE__, __LINE__);
facts_init(&facts);
- TEST_EQ(facts_open_file(&facts,
- "facts_test_open_file.1.facts"),
- 798);
+ str_init_1(&path, NULL, "facts_test_open_file.1.facts");
+ TEST_EQ(facts_open_file(&facts, &path), 798);
TEST_EQ(facts_count(&facts), 23);
i = 0;
while (p[i]) {
@@ -488,9 +488,8 @@ void facts_test_open_file ()
err(1, "%s:%i: cp", __FILE__, __LINE__);
if (r > 0)
errx(1, "%s:%i: cp", __FILE__, __LINE__);
- TEST_EQ(facts_open_file(&facts,
- "facts_test_open_file.2.facts"),
- 1531);
+ str_init_1(&path, NULL, "facts_test_open_file.2.facts");
+ TEST_EQ(facts_open_file(&facts, &path), 1531);
TEST_EQ(facts_count(&facts), 46);
i = 0;
while (p[i]) {
@@ -517,9 +516,8 @@ void facts_test_open_file ()
err(1, "%s:%i: cp", __FILE__, __LINE__);
if (r > 0)
errx(1, "%s:%i: cp", __FILE__, __LINE__);
- TEST_EQ(facts_open_file(&facts,
- "facts_test_open_file.3.facts"),
- 1588);
+ str_init_1(&path, NULL, "facts_test_open_file.3.facts");
+ TEST_EQ(facts_open_file(&facts, &path), 1588);
TEST_EQ(facts_count(&facts), 0);
i = 0;
while (p[i]) {
@@ -553,8 +551,8 @@ void facts_test_remove ()
":a",
"A",
"a",
- "[]",
- "[[], []]",
+ "()",
+ "((), ())",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -602,8 +600,8 @@ void facts_test_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 b171f23..236f018 100644
--- a/test/facts_test_dump_file.expected.facts
+++ b/test/facts_test_dump_file.expected.facts
@@ -15,8 +15,8 @@
{256, 256, 256}
{65536, 65536, 65536}
{4294967296, 4294967296, 4294967296}
-{[], [], []}
-{[[], []], [[], []], [[], []]}
+{(), (), ()}
+{((), ()), ((), ()), ((), ())}
{"a", "a", "a"}
{A, A, A}
{:a, :a, :a}
@@ -24,4 +24,4 @@
{{:a, :b}, {:a, :b}, {:a, :b}}
{{{a, b}, {c, d}}, {{a, b}, {c, d}}, {{a, b}, {c, d}}}
{{{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}}
-%{hash: 0xF8C5A41402BC491F}
+%{hash: 0x08DD94636F1EB189}
diff --git a/test/facts_test_load_file.facts b/test/facts_test_load_file.facts
index b171f23..236f018 100644
--- a/test/facts_test_load_file.facts
+++ b/test/facts_test_load_file.facts
@@ -15,8 +15,8 @@
{256, 256, 256}
{65536, 65536, 65536}
{4294967296, 4294967296, 4294967296}
-{[], [], []}
-{[[], []], [[], []], [[], []]}
+{(), (), ()}
+{((), ()), ((), ()), ((), ())}
{"a", "a", "a"}
{A, A, A}
{:a, :a, :a}
@@ -24,4 +24,4 @@
{{:a, :b}, {:a, :b}, {:a, :b}}
{{{a, b}, {c, d}}, {{a, b}, {c, d}}, {{a, b}, {c, d}}}
{{{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}}
-%{hash: 0xF8C5A41402BC491F}
+%{hash: 0x08DD94636F1EB189}
diff --git a/test/facts_test_log_add.expected.facts b/test/facts_test_log_add.expected.facts
index 5286f7a..7f1260b 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 f96c838..57fb991 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 345a021..4488c58 100644
--- a/test/facts_test_open_file.1.expected.facts
+++ b/test/facts_test_open_file.1.expected.facts
@@ -17,8 +17,8 @@
{256, 256, 256}
{65536, 65536, 65536}
{4294967296, 4294967296, 4294967296}
-{[], [], []}
-{[[], []], [[], []], [[], []]}
+{(), (), ()}
+{((), ()), ((), ()), ((), ())}
{"a", "a", "a"}
{A, A, A}
{:a, :a, :a}
@@ -26,13 +26,13 @@
{{:a, :b}, {:a, :b}, {:a, :b}}
{{{a, b}, {c, d}}, {{a, b}, {c, d}}, {{a, b}, {c, d}}}
{{{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}}
-%{hash: 0xF8C5A41402BC491F}
+%{hash: 0x08DD94636F1EB189}
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}}
@@ -54,8 +54,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 7cbcba1..cf3a10a 100644
--- a/test/facts_test_open_file.1.in.facts
+++ b/test/facts_test_open_file.1.in.facts
@@ -17,8 +17,8 @@
{256, 256, 256}
{65536, 65536, 65536}
{4294967296, 4294967296, 4294967296}
-{[], [], []}
-{[[], []], [[], []], [[], []]}
+{(), (), ()}
+{((), ()), ((), ()), ((), ())}
{"a", "a", "a"}
{A, A, A}
{:a, :a, :a}
@@ -26,4 +26,4 @@
{{:a, :b}, {:a, :b}, {:a, :b}}
{{{a, b}, {c, d}}, {{a, b}, {c, d}}, {{a, b}, {c, d}}}
{{{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}}
-%{hash: 0xF8C5A41402BC491F}
+%{hash: 0x08DD94636F1EB189}
diff --git a/test/facts_test_open_file.2.expected.facts b/test/facts_test_open_file.2.expected.facts
index a6435d5..b53142e 100644
--- a/test/facts_test_open_file.2.expected.facts
+++ b/test/facts_test_open_file.2.expected.facts
@@ -17,8 +17,8 @@
{256, 256, 256}
{65536, 65536, 65536}
{4294967296, 4294967296, 4294967296}
-{[], [], []}
-{[[], []], [[], []], [[], []]}
+{(), (), ()}
+{((), ()), ((), ()), ((), ())}
{"a", "a", "a"}
{A, A, A}
{:a, :a, :a}
@@ -26,7 +26,7 @@
{{:a, :b}, {:a, :b}, {:a, :b}}
{{{a, b}, {c, d}}, {{a, b}, {c, d}}, {{a, b}, {c, d}}}
{{{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}}
-%{hash: 0xF8C5A41402BC491F}
+%{hash: 0x08DD94636F1EB189}
add {b, b, b}
add {-18446744073709551617, -18446744073709551617, -18446744073709551617}
add {18446744073709551617, 18446744073709551617, 18446744073709551617}
@@ -41,8 +41,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 a6435d5..b53142e 100644
--- a/test/facts_test_open_file.2.in.facts
+++ b/test/facts_test_open_file.2.in.facts
@@ -17,8 +17,8 @@
{256, 256, 256}
{65536, 65536, 65536}
{4294967296, 4294967296, 4294967296}
-{[], [], []}
-{[[], []], [[], []], [[], []]}
+{(), (), ()}
+{((), ()), ((), ()), ((), ())}
{"a", "a", "a"}
{A, A, A}
{:a, :a, :a}
@@ -26,7 +26,7 @@
{{:a, :b}, {:a, :b}, {:a, :b}}
{{{a, b}, {c, d}}, {{a, b}, {c, d}}, {{a, b}, {c, d}}}
{{{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}}
-%{hash: 0xF8C5A41402BC491F}
+%{hash: 0x08DD94636F1EB189}
add {b, b, b}
add {-18446744073709551617, -18446744073709551617, -18446744073709551617}
add {18446744073709551617, 18446744073709551617, 18446744073709551617}
@@ -41,8 +41,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 8fe30ac..da01a1e 100644
--- a/test/facts_test_open_file.3.expected.facts
+++ b/test/facts_test_open_file.3.expected.facts
@@ -17,8 +17,8 @@
{256, 256, 256}
{65536, 65536, 65536}
{4294967296, 4294967296, 4294967296}
-{[], [], []}
-{[[], []], [[], []], [[], []]}
+{(), (), ()}
+{((), ()), ((), ()), ((), ())}
{"a", "a", "a"}
{A, A, A}
{:a, :a, :a}
@@ -26,7 +26,7 @@
{{:a, :b}, {:a, :b}, {:a, :b}}
{{{a, b}, {c, d}}, {{a, b}, {c, d}}, {{a, b}, {c, d}}}
{{{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}}
-%{hash: 0xF8C5A41402BC491F}
+%{hash: 0x08DD94636F1EB189}
remove {a, a, a}
remove {-18446744073709551616, -18446744073709551616, -18446744073709551616}
remove {18446744073709551616, 18446744073709551616, 18446744073709551616}
@@ -41,8 +41,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}
@@ -54,8 +54,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}}
@@ -77,8 +77,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 0c8b296..595b4d5 100644
--- a/test/facts_test_open_file.3.in.facts
+++ b/test/facts_test_open_file.3.in.facts
@@ -17,8 +17,8 @@
{256, 256, 256}
{65536, 65536, 65536}
{4294967296, 4294967296, 4294967296}
-{[], [], []}
-{[[], []], [[], []], [[], []]}
+{(), (), ()}
+{((), ()), ((), ()), ((), ())}
{"a", "a", "a"}
{A, A, A}
{:a, :a, :a}
@@ -26,7 +26,7 @@
{{:a, :b}, {:a, :b}, {:a, :b}}
{{{a, b}, {c, d}}, {{a, b}, {c, d}}, {{a, b}, {c, d}}}
{{{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}}
-%{hash: 0xF8C5A41402BC491F}
+%{hash: 0x08DD94636F1EB189}
remove {a, a, a}
remove {-18446744073709551616, -18446744073709551616, -18446744073709551616}
remove {18446744073709551616, 18446744073709551616, 18446744073709551616}
@@ -41,8 +41,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 7cbcba1..cf3a10a 100644
--- a/test/facts_test_save.expected.facts
+++ b/test/facts_test_save.expected.facts
@@ -17,8 +17,8 @@
{256, 256, 256}
{65536, 65536, 65536}
{4294967296, 4294967296, 4294967296}
-{[], [], []}
-{[[], []], [[], []], [[], []]}
+{(), (), ()}
+{((), ()), ((), ()), ((), ())}
{"a", "a", "a"}
{A, A, A}
{:a, :a, :a}
@@ -26,4 +26,4 @@
{{:a, :b}, {:a, :b}, {:a, :b}}
{{{a, b}, {c, d}}, {{a, b}, {c, d}}, {{a, b}, {c, d}}}
{{{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}, {{:a, :b}, {:c, :d}}}
-%{hash: 0xF8C5A41402BC491F}
+%{hash: 0x08DD94636F1EB189}
diff --git a/test/list_test.c b/test/list_test.c
index 6896bc7..e0ef39b 100644
--- a/test/list_test.c
+++ b/test/list_test.c
@@ -51,21 +51,21 @@ void list_test ()
void list_test_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)");
}
void list_test_inspect ()
{
- LIST_TEST_INSPECT("[]", "[]");
- LIST_TEST_INSPECT("[[] | []]", "[[]]");
- LIST_TEST_INSPECT("[[], [] | []]", "[[], []]");
+ LIST_TEST_INSPECT("()", "()");
+ LIST_TEST_INSPECT("(() | ())", "(())");
+ LIST_TEST_INSPECT("((), () | ())", "((), ())");
}
diff --git a/test/set__fact_test.c b/test/set__fact_test.c
index 80e6814..dcf76ef 100644
--- a/test/set__fact_test.c
+++ b/test/set__fact_test.c
@@ -99,8 +99,8 @@ void set__fact_test_add ()
":a",
"A",
"a",
- "[]",
- "[[], []]",
+ "()",
+ "((), ())",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -146,8 +146,8 @@ void set__fact_test_cursor ()
":a",
"A",
"a",
- "[]",
- "[[], []]",
+ "()",
+ "((), ())",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -229,8 +229,8 @@ void set__fact_test_remove ()
":a",
"A",
"a",
- "[]",
- "[[], []]",
+ "()",
+ "((), ())",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -275,8 +275,8 @@ void set__fact_test_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 36f18ac..7af40d0 100644
--- a/test/set__tag_test.c
+++ b/test/set__tag_test.c
@@ -70,8 +70,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 +126,8 @@ void set__tag_test_add ()
"A.a(b, c)",
"B.a(b, c)",
"A.b(b, c)",
- "[]",
- "[[], []]",
+ "()",
+ "((), ())",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -175,9 +175,9 @@ void set__tag_test_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);
@@ -222,9 +222,9 @@ void set__tag_test_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);
@@ -309,8 +309,8 @@ void set__tag_test_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}"));
@@ -337,10 +337,10 @@ void set__tag_test_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);
@@ -392,10 +392,10 @@ void set__tag_test_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 6e65b91..e47524b 100644
--- a/test/skiplist__fact_test.c
+++ b/test/skiplist__fact_test.c
@@ -75,8 +75,8 @@ void skiplist__fact_test_find ()
":a",
"A",
"a",
- "[]",
- "[[], []]",
+ "()",
+ "((), ())",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -132,8 +132,8 @@ void skiplist__fact_test_insert ()
":a",
"A",
"a",
- "[]",
- "[[], []]",
+ "()",
+ "((), ())",
"{:a, :b}",
"{{:a, :b}, {:c, :d}}",
"{a, b}",
@@ -202,8 +202,8 @@ void skiplist__fact_test_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 94147d2..ef4e561 100644
--- a/test/tag_test.c
+++ b/test/tag_test.c
@@ -50,7 +50,7 @@ void tag_test_hash_u64 ()
void tag_test_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);