Skip to content

Commit

Permalink
for func and builtin in general testing
Browse files Browse the repository at this point in the history
  • Loading branch information
hyorigo committed Jan 8, 2024
1 parent bec8efe commit 6739868
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dataconv/marshal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func TestMarshal(t *testing.T) {
{map[interface{}]interface{}{"foo": 42, "bar": &customType{42}}, expectedStrDictCustomType, ""},
{[]interface{}{42, &customType{42}}, starlark.NewList([]starlark.Value{starlark.MakeInt(42), ct}), ""},
{&invalidCustomType{42}, starlark.None, "unrecognized type: &dataconv.invalidCustomType{Foo:42}"},
{complex(1, 2), starlark.None, "unrecognized type: (1+2i)"},
}

for i, c := range cases {
Expand Down Expand Up @@ -191,6 +192,8 @@ func TestUnmarshal(t *testing.T) {
{nilGst, nil, "nil GoStruct"},
{(*convert.GoInterface)(nil), nil, "nil GoInterface"},
{nilGif, nil, "nil GoInterface"},
{mockStarlarkBuiltin("foo"), nil, "unrecognized starlark type: *starlark.Builtin"},
{asStarlarkFunc("foo", `def foo(): return "foo"`), nil, "unrecognized starlark type: *starlark.Function"},
}
for i, c := range cases {
got, err := Unmarshal(c.in)
Expand Down

0 comments on commit 6739868

Please sign in to comment.