expr_test.go, more tests on the int() function

This commit is contained in:
Celestino Amoroso 2024-04-20 08:50:05 +02:00
parent 730b59e6d3
commit 6ae5ca34ed

View File

@ -21,6 +21,7 @@ func TestExpr(t *testing.T) {
/* 1 */ {`0?{}`, nil, nil}, /* 1 */ {`0?{}`, nil, nil},
/* 2 */ {`fact=func(n){(n)?{1}::{n*fact(n-1)}}; fact(5)`, int64(120), nil}, /* 2 */ {`fact=func(n){(n)?{1}::{n*fact(n-1)}}; fact(5)`, int64(120), nil},
/* 3 */ {`f=openFile("test-file.txt"); line=readFile(f); closeFile(f); line`, "uno", nil}, /* 3 */ {`f=openFile("test-file.txt"); line=readFile(f); closeFile(f); line`, "uno", nil},
/* 4 */ {`mynot=func(v){int(v)?{true}::{false}}; mynot(0)`, true, nil},
} }
succeeded := 0 succeeded := 0