Skip to content

Commit

Permalink
Merge pull request fatih#67 from mammothbane/master
Browse files Browse the repository at this point in the history
field: test CanSet failure
  • Loading branch information
fatih authored Jul 1, 2016
2 parents bfcf7ee + 3ecfced commit be738c8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions field_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,20 @@ func TestField_Set(t *testing.T) {
}
}

func TestField_NotSettable(t *testing.T) {
a := map[int]Baz{
4: Baz{
A: "value",
},
}

s := New(a[4])

if err := s.Field("A").Set("newValue"); err != errNotSettable {
t.Errorf("Trying to set non-settable field should error with %q. Got %q instead.", errNotSettable, err)
}
}

func TestField_Zero(t *testing.T) {
s := newStruct()

Expand Down

0 comments on commit be738c8

Please sign in to comment.