xgo/testdata/cli/test.tengo
Ozan Hacıbekiroğlu 4ed75764ce
enable relative imports (#285)
* enable relative imports

* update per 1st review

* remove symlink stuffs

* fix cli run in make file

* make resolving import path explicit

* fix importDir
2020-05-22 13:57:38 -07:00

15 lines
428 B
Text
Executable file

#!/usr/bin/env tengo
os := import("os")
one := import("one")
fmt := import("fmt")
text := import("text")
expected := ["test", "one", "two", "three", "four", "five"]
expected = text.join(expected, " ")
if v := one.fn("test"); v != expected {
fmt.printf("relative import test error:\n\texpected: %v\n\tgot : %v\n",
expected, v)
os.exit(1)
}
args := text.join(os.args(), " ")
fmt.println("ok\t", args)