(t *testing.T)
| 49 | } |
| 50 | |
| 51 | func TestNewUserAgentParser_GC(t *testing.T) { |
| 52 | if !testutils.IsSingleTesting() { |
| 53 | return |
| 54 | } |
| 55 | |
| 56 | var parser = stats.NewUserAgentParser() |
| 57 | |
| 58 | for i := 0; i < 1_000_000; i++ { |
| 59 | parser.Parse("Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36 Test/" + types.String(rands.Int(0, 100_000))) |
| 60 | } |
| 61 | |
| 62 | time.Sleep(60 * time.Second) // wait to gc |
| 63 | t.Log(parser.Len(), "cache items") |
| 64 | } |
| 65 | |
| 66 | func TestNewUserAgentParser_Mobile(t *testing.T) { |
| 67 | var a = assert.NewAssertion(t) |
nothing calls this directly
no test coverage detected