This commit is contained in:
Albert Skalt 2023-04-23 12:26:15 +03:00 committed by Fedor Korotkiy
parent c65527f821
commit 11277ded5b

View file

@ -17,3 +17,11 @@ func TestIllegalField(t *testing.T) {
assert.Equal(t, "10 foo", s.String()) assert.Equal(t, "10 foo", s.String())
} }
func TestIllegalWrongFieldType(t *testing.T) {
var s internal.Struct
assert.Panics(t, func() {
illegal.SetPrivateField(&s, "a", "1234")
})
}