1
0
mirror of https://github.com/robertkrimen/otto synced 2025-09-28 18:45:22 +08:00
otto/builtin_test.go
2012-10-18 11:16:25 -07:00

19 lines
429 B
Go

package otto
import (
"testing"
. "github.com/robertkrimen/terst"
)
func TestString_fromCharCode(t *testing.T) {
Terst(t)
test := runTest()
test(`String.fromCharCode()`, "")
test(`String.fromCharCode(88, 121, 122, 122, 121)`, "Xyzzy")
test(`String.fromCharCode("88", 121, 122, 122.05, 121)`, "Xyzzy")
test(`String.fromCharCode("88", 121, 122, NaN, 121)`, "Xyz\x00y")
test(`String.fromCharCode("0x21")`, "!")
}