Skip to content

Commit

Permalink
Test the return value for method call with argument
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanahsmith committed Sep 8, 2021
1 parent 50663bd commit aa2a8f5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion object_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ func TestObjectMethodCall(t *testing.T) {
failIf(t, err)
obj, _ = val.AsObject()
arg, _ := v8go.NewValue(iso, "arg")
_, err = obj.MethodCall("print", arg)
val, err = obj.MethodCall("print", arg)
failIf(t, err)
if val.String() != "arg" {
t.Errorf("unexpected value: %q", val)
}
_, err = obj.MethodCall("fails")
if err == nil {
t.Errorf("expected an error, got none")
Expand Down

0 comments on commit aa2a8f5

Please sign in to comment.