(t *testing.T)
| 11 | } |
| 12 | |
| 13 | func TestBasic(t *testing.T) { |
| 14 | type Foo struct { |
| 15 | A int |
| 16 | B int |
| 17 | C int |
| 18 | } |
| 19 | |
| 20 | f := Foo{1, 2, 3} |
| 21 | fv := reflect.ValueOf(f) |
| 22 | m := NewMapperFunc("", func(s string) string { return s }) |
| 23 | |
| 24 | v := m.FieldByName(fv, "A") |
| 25 | if ival(v) != f.A { |
| 26 | t.Errorf("Expecting %d, got %d", ival(v), f.A) |
| 27 | } |
| 28 | v = m.FieldByName(fv, "B") |
| 29 | if ival(v) != f.B { |
| 30 | t.Errorf("Expecting %d, got %d", f.B, ival(v)) |
| 31 | } |
| 32 | v = m.FieldByName(fv, "C") |
| 33 | if ival(v) != f.C { |
| 34 | t.Errorf("Expecting %d, got %d", f.C, ival(v)) |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | func TestBasicEmbedded(t *testing.T) { |
| 39 | type Foo struct { |
nothing calls this directly
no test coverage detected