From bd4f3680ea92aecbb948a6193e636fe4cd040459 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Thu, 10 Oct 2013 17:48:37 +0900 Subject: [PATCH] do object create test before entering main --- src/main.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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("> ");