diff --git a/src/main.c b/src/main.c index ae8bf8c7..806c720f 100644 --- a/src/main.c +++ b/src/main.c @@ -2,6 +2,28 @@ #include "picrin.h" +void +test_object_creation(pic_state *pic) +{ + pic_value v; + + { + v = pic_intern_cstr(pic, "symbol"); + pic_debug(pic, v); + puts(" [should be `symbol`]"); + } + { + v = pic_nil_value(); + pic_debug(pic, v); + puts(" [should be `()`]"); + } + { + v = pic_cons(pic, pic_intern_cstr(pic, "foo"), pic_intern_cstr(pic, "bar")); + pic_debug(pic, v); + puts(" [should be `(foo . bar)`]"); + } +} + #define LINE_MAX_LENGTH 256 int @@ -13,6 +35,8 @@ main() pic = pic_open(); + test_object_creation(pic); + while (1) { printf("> ");