1
0
mirror of https://github.com/robertkrimen/otto synced 2025-10-19 19:55:30 +08:00
otto/object_test.go
Robert Krimen 20d2e8bba6 gofmt
Ugh.
2013-01-25 09:59:42 -08:00

26 lines
471 B
Go

package otto
import (
. "github.com/robertkrimen/terst"
"testing"
)
func TestObject_(t *testing.T) {
Terst(t)
object := newObject(nil, "")
IsTrue(object != nil)
object.put("xyzzy", toValue("Nothing happens."), true)
Is(object.get("xyzzy"), "Nothing happens.")
}
func TestStringObject(t *testing.T) {
Terst(t)
object := New().runtime.newStringObject(toValue("xyzzy"))
Is(object.get("1"), "y")
Is(object.get("10"), "undefined")
Is(object.get("2"), "z")
}