do object create test before entering main

This commit is contained in:
Yuichi Nishiwaki 2013-10-10 17:48:37 +09:00
parent b640dc08e8
commit bd4f3680ea
1 changed files with 24 additions and 0 deletions

View File

@ -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("> ");