(testCases []detectorTestCase)
| 31 | } |
| 32 | |
| 33 | func (s *ClientFeaturesDetectorSuite) runTestCases(testCases []detectorTestCase) { |
| 34 | for _, tc := range testCases { |
| 35 | s.Run(tc.name, func() { |
| 36 | detector := clientfeatures.NewDetector(&tc.config) |
| 37 | |
| 38 | header := make(http.Header) |
| 39 | for k, v := range tc.header { |
| 40 | header.Set(k, v) |
| 41 | } |
| 42 | |
| 43 | features := detector.Features(header) |
| 44 | s.Require().Equal(tc.expected, features) |
| 45 | }) |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | func (s *ClientFeaturesDetectorSuite) TestFeaturesAutoFormats() { |
| 50 | s.runTestCases([]detectorTestCase{ |
no test coverage detected