Skip to content

Commit

Permalink
test unsupported value type given to coerceValue
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanahsmith committed Sep 8, 2021
1 parent 711901e commit d8b9c5e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion object_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ func TestObjectSet(t *testing.T) {
if err := obj.Set("a", 0); err == nil {
t.Error("expected error but got <nil>")
}
obj.SetIdx(10, "ten")
if err := obj.SetIdx(10, "ten"); err != nil {
t.Errorf("unexpected error: %v", err)
}
if err := obj.SetIdx(10, t); err == nil {
t.Error("expected error but got <nil>")
}
if ten, _ := ctx.RunScript("foo[10]", ""); ten.String() != "ten" {
t.Errorf("unexpected value: %q", ten)
}
Expand Down

0 comments on commit d8b9c5e

Please sign in to comment.