(t *testing.T)
| 74 | } |
| 75 | |
| 76 | func TestEntryCaller(t *testing.T) { |
| 77 | tests := []struct { |
| 78 | caller EntryCaller |
| 79 | full string |
| 80 | short string |
| 81 | }{ |
| 82 | { |
| 83 | caller: NewEntryCaller(100, "/path/to/foo.go", 42, false), |
| 84 | full: "undefined", |
| 85 | short: "undefined", |
| 86 | }, |
| 87 | { |
| 88 | caller: NewEntryCaller(100, "/path/to/foo.go", 42, true), |
| 89 | full: "/path/to/foo.go:42", |
| 90 | short: "to/foo.go:42", |
| 91 | }, |
| 92 | { |
| 93 | caller: NewEntryCaller(100, "to/foo.go", 42, true), |
| 94 | full: "to/foo.go:42", |
| 95 | short: "to/foo.go:42", |
| 96 | }, |
| 97 | } |
| 98 | |
| 99 | for _, tt := range tests { |
| 100 | assert.Equal(t, tt.full, tt.caller.String(), "Unexpected string from EntryCaller.") |
| 101 | assert.Equal(t, tt.full, tt.caller.FullPath(), "Unexpected FullPath from EntryCaller.") |
| 102 | assert.Equal(t, tt.short, tt.caller.TrimmedPath(), "Unexpected TrimmedPath from EntryCaller.") |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | func TestCheckedEntryWrite(t *testing.T) { |
| 107 | t.Run("nil is safe", func(t *testing.T) { |
nothing calls this directly
no test coverage detected