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
11 lines
466 B
Go
11 lines
466 B
Go
package stdlib_test
|
|
|
|
import "testing"
|
|
|
|
func TestFmtSprintf(t *testing.T) {
|
|
module(t, `fmt`).call("sprintf", "").expect("")
|
|
module(t, `fmt`).call("sprintf", "foo").expect("foo")
|
|
module(t, `fmt`).call("sprintf", `foo %d %v %s`, 1, 2, "bar").expect("foo 1 2 bar")
|
|
module(t, `fmt`).call("sprintf", "foo %v", `[1, "bar", true]`).expect(`foo [1, "bar", true]`)
|
|
module(t, `fmt`).call("sprintf", "foo %v %d", `[1, "bar", true]`, 19).expect(`foo [1, "bar", true] 19`)
|
|
}
|