mirror of
https://github.com/MontFerret/ferret.git
synced 2025-12-03 22:24:14 +02:00
feat(runtime): check Kind() by 0 or Interface() panic (#587)
This commit is contained in:
@@ -145,4 +145,28 @@ func TestParam(t *testing.T) {
|
||||
So(err, ShouldNotBeNil)
|
||||
So(err.Error(), ShouldContainSubstring, "subattr")
|
||||
})
|
||||
|
||||
Convey("Should be possible to use in struct with nested struct which nil", t, func() {
|
||||
type Some2 struct {
|
||||
}
|
||||
type Some struct {
|
||||
Some2 *Some2
|
||||
}
|
||||
|
||||
someObj := &Some{}
|
||||
prog := compiler.New().
|
||||
MustCompile(`
|
||||
|
||||
RETURN null
|
||||
`)
|
||||
|
||||
panics := func() {
|
||||
_, _ = prog.Run(
|
||||
context.Background(),
|
||||
runtime.WithParam("struct", someObj),
|
||||
)
|
||||
}
|
||||
|
||||
So(panics, ShouldNotPanic)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user