(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func TestRequiredAcks(t *testing.T) { |
| 13 | for _, acks := range []RequiredAcks{ |
| 14 | RequireNone, |
| 15 | RequireOne, |
| 16 | RequireAll, |
| 17 | } { |
| 18 | t.Run(acks.String(), func(t *testing.T) { |
| 19 | a := strconv.Itoa(int(acks)) |
| 20 | x := RequiredAcks(-2) |
| 21 | y := RequiredAcks(-2) |
| 22 | b, err := acks.MarshalText() |
| 23 | if err != nil { |
| 24 | t.Fatal(err) |
| 25 | } |
| 26 | |
| 27 | if err := x.UnmarshalText([]byte(a)); err != nil { |
| 28 | t.Fatal(err) |
| 29 | } |
| 30 | if err := y.UnmarshalText(b); err != nil { |
| 31 | t.Fatal(err) |
| 32 | } |
| 33 | |
| 34 | if x != acks { |
| 35 | t.Errorf("required acks mismatch after marshal/unmarshal text: want=%s got=%s", acks, x) |
| 36 | } |
| 37 | if y != acks { |
| 38 | t.Errorf("required acks mismatch after marshal/unmarshal value: want=%s got=%s", acks, y) |
| 39 | } |
| 40 | }) |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | func TestClientProduce(t *testing.T) { |
| 45 | client, topic, shutdown := newLocalClientAndTopic() |
nothing calls this directly
no test coverage detected