(t *testing.T)
| 676 | } |
| 677 | |
| 678 | func TestCallerEncoders(t *testing.T) { |
| 679 | caller := EntryCaller{Defined: true, File: "/home/jack/src/github.com/foo/foo.go", Line: 42} |
| 680 | tests := []struct { |
| 681 | name string |
| 682 | expected interface{} // output of serializing caller |
| 683 | }{ |
| 684 | {"", "foo/foo.go:42"}, |
| 685 | {"something-random", "foo/foo.go:42"}, |
| 686 | {"short", "foo/foo.go:42"}, |
| 687 | {"full", "/home/jack/src/github.com/foo/foo.go:42"}, |
| 688 | } |
| 689 | |
| 690 | for _, tt := range tests { |
| 691 | var ce CallerEncoder |
| 692 | require.NoError(t, ce.UnmarshalText([]byte(tt.name)), "Unexpected error unmarshaling %q.", tt.name) |
| 693 | assertAppended( |
| 694 | t, |
| 695 | tt.expected, |
| 696 | func(arr ArrayEncoder) { ce(caller, arr) }, |
| 697 | "Unexpected output serializing file name as %v with %q.", tt.expected, tt.name, |
| 698 | ) |
| 699 | } |
| 700 | } |
| 701 | |
| 702 | func TestNameEncoders(t *testing.T) { |
| 703 | tests := []struct { |
nothing calls this directly
no test coverage detected