do object create test before entering main
This commit is contained in:
parent
b640dc08e8
commit
bd4f3680ea
24
src/main.c
24
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("> ");
|
||||
|
||||
|
|
Loading…
Reference in New Issue