xgo/runtime/vm_source_modules_test.go
Daniel 61890b15cb
module refactor (#148)
* 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
2019-03-18 08:15:26 -07:00

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)
}