61890b15cb
* wip * move print and JSON functions to modules * builtin functions are not replacable now * builtin functions are added for default nil symbol table * importables: builtin modules and source modules * refactoring runtime tests * fix tests * update documentation * cleanup * clean up cli * fix REPL prints
13 lines
272 B
Go
13 lines
272 B
Go
package runtime_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/d5/tengo/stdlib"
|
|
)
|
|
|
|
func TestSourceModules(t *testing.T) {
|
|
expect(t, `enum := import("enum"); out = enum.any([1,2,3], func(i, v) { return v == 2 })`,
|
|
Opts().Module("enum", stdlib.SourceModules["enum"]),
|
|
true)
|
|
}
|