(t *testing.T)
| 839 | } |
| 840 | |
| 841 | func Test_Client_ConcurrencyRequests(t *testing.T) { |
| 842 | t.Parallel() |
| 843 | |
| 844 | app, dial, start := createHelperServer(t) |
| 845 | app.All("/", func(c fiber.Ctx) error { |
| 846 | return c.SendString(c.Hostname() + " " + c.Method()) |
| 847 | }) |
| 848 | go start() |
| 849 | |
| 850 | client := New().SetDial(dial) |
| 851 | |
| 852 | wg := sync.WaitGroup{} |
| 853 | for range 5 { |
| 854 | for _, method := range []string{"GET", "POST", "PUT", "DELETE", "PATCH"} { |
| 855 | m := method |
| 856 | wg.Go(func() { |
| 857 | resp, err := client.Custom("http://example.com", m) |
| 858 | require.NoError(t, err) |
| 859 | assert.Equal(t, "example.com "+m, utils.UnsafeString(resp.RawResponse.Body())) |
| 860 | }) |
| 861 | } |
| 862 | } |
| 863 | |
| 864 | wg.Wait() |
| 865 | } |
| 866 | |
| 867 | func Test_Get(t *testing.T) { |
| 868 | t.Parallel() |
nothing calls this directly
no test coverage detected