(t *testing.T)
| 560 | } |
| 561 | |
| 562 | func TestFieldsArrayEmpty(t *testing.T) { |
| 563 | out := &bytes.Buffer{} |
| 564 | log := New(out) |
| 565 | log.Log(). |
| 566 | Objects("objs", []LogObjectMarshaler{}). |
| 567 | ObjectsV("objs_v"). |
| 568 | Strs("strs", []string{}). |
| 569 | StrsV("strs_v"). |
| 570 | Stringers("stringers", []fmt.Stringer{}). |
| 571 | StringersV("stringers_v"). |
| 572 | Errs("err", []error{}). |
| 573 | Bools("bool", []bool{}). |
| 574 | Ints("int", []int{}). |
| 575 | Ints8("int8", []int8{}). |
| 576 | Ints16("int16", []int16{}). |
| 577 | Ints32("int32", []int32{}). |
| 578 | Ints64("int64", []int64{}). |
| 579 | Uints("uint", []uint{}). |
| 580 | Uints8("uint8", []uint8{}). |
| 581 | Uints16("uint16", []uint16{}). |
| 582 | Uints32("uint32", []uint32{}). |
| 583 | Uints64("uint64", []uint64{}). |
| 584 | Floats32("float32", []float32{}). |
| 585 | Floats64("float64", []float64{}). |
| 586 | Durs("dur", []time.Duration{}). |
| 587 | Times("time", []time.Time{}). |
| 588 | IPAddrs("ip", []net.IP{}). |
| 589 | IPPrefixes("pfx", []net.IPNet{}). |
| 590 | Msg("") |
| 591 | if got, want := decodeIfBinaryToString(out.Bytes()), `{"objs":[],"objs_v":[],"strs":[],"strs_v":[],"stringers":[],"stringers_v":[],"err":[],"bool":[],"int":[],"int8":[],"int16":[],"int32":[],"int64":[],"uint":[],"uint8":[],"uint16":[],"uint32":[],"uint64":[],"float32":[],"float64":[],"dur":[],"time":[],"ip":[],"pfx":[]}`+"\n"; got != want { |
| 592 | t.Errorf("invalid log output:\ngot: %v\nwant: %v", got, want) |
| 593 | } |
| 594 | } |
| 595 | |
| 596 | func TestFieldsArraySingleElement(t *testing.T) { |
| 597 | out := &bytes.Buffer{} |
nothing calls this directly
no test coverage detected