(t *testing.T)
| 64 | } |
| 65 | |
| 66 | func TestMiddlewareWithoutLocale(t *testing.T) { |
| 67 | r, err := http.NewRequest("GET", "http://example.com/test", nil) |
| 68 | require.NoError(t, err) |
| 69 | |
| 70 | rec := new(httpRecorderNext) |
| 71 | h := Handler()(rec) |
| 72 | h.ServeHTTP(nil, r) |
| 73 | |
| 74 | lctx, ok := FromCtx(rec.r.Context()) |
| 75 | require.True(t, ok) |
| 76 | assert.False(t, lctx.HasLanguage()) |
| 77 | assert.False(t, lctx.HasTimezone()) |
| 78 | } |
| 79 | |
| 80 | func TestMiddlewareWithLocale(t *testing.T) { |
| 81 | l := NewLocale("fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7, *;q=0.5", "Europe/Paris") |
nothing calls this directly
no test coverage detected
searching dependent graphs…