mirror of
https://github.com/ValKmjolnir/Nasal-Interpreter.git
synced 2026-05-24 05:25:45 +08:00
add test file diff.nas
This commit is contained in:
1
makefile
1
makefile
@@ -16,6 +16,7 @@ test:nasal
|
||||
@ ./nasal -op -e -d test/calc.nas
|
||||
@ ./nasal -op -e test/choice.nas
|
||||
@ ./nasal -op -e test/class.nas
|
||||
@ ./nasal -op -e test/diff.nas
|
||||
-@ ./nasal -op -d test/exception.nas
|
||||
@ ./nasal -op -t -d test/fib.nas
|
||||
@ ./nasal -op -e test/filesystem.nas
|
||||
|
||||
@@ -424,7 +424,7 @@ nasal_ref builtin_str(nasal_ref* local,nasal_gc& gc)
|
||||
nasal_ref builtin_size(nasal_ref* local,nasal_gc& gc)
|
||||
{
|
||||
nasal_ref val=local[1];
|
||||
double num;
|
||||
double num=0;
|
||||
switch(val.type)
|
||||
{
|
||||
case vm_num: num=val.num(); break;
|
||||
|
||||
@@ -38,6 +38,7 @@ var testfile=[
|
||||
"test/calc.nas ",
|
||||
"test/choice.nas ",
|
||||
"test/class.nas ",
|
||||
"test/diff.nas ",
|
||||
"test/exception.nas ",
|
||||
"test/fib.nas ",
|
||||
"test/filesystem.nas ",
|
||||
|
||||
@@ -191,4 +191,10 @@ var a={
|
||||
}
|
||||
};
|
||||
println(isa(a.new(),a)); # 1
|
||||
println(isa(a.new2(),a));# 0
|
||||
println(isa(a.new2(),a));# 0
|
||||
|
||||
var a=[10,-10,0,1,2,3,nil,"string","hello",[],[0,1,2,3],{},{a:0,b:1,c:2},func{}];
|
||||
println("type\tsize\tnum\tsrc");
|
||||
foreach(var i;a){
|
||||
println(typeof(i),'\t',size(i),'\t',num(i),'\t',i);
|
||||
}
|
||||
Reference in New Issue
Block a user