2021-04-14 15:41:01 +00:00
|
|
|
package illegal_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2022-04-17 15:28:33 +00:00
|
|
|
|
2021-04-14 15:41:01 +00:00
|
|
|
"gitlab.com/slon/shad-go/illegal"
|
|
|
|
"gitlab.com/slon/shad-go/illegal/internal"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestIllegalField(t *testing.T) {
|
|
|
|
var s internal.Struct
|
|
|
|
|
|
|
|
illegal.SetPrivateField(&s, "a", 10)
|
|
|
|
illegal.SetPrivateField(&s, "b", "foo")
|
|
|
|
|
|
|
|
assert.Equal(t, "10 foo", s.String())
|
|
|
|
}
|