| 58 | }; |
| 59 | |
| 60 | TEST_F(TestWinsorize, FloatingPoint) { |
| 61 | for (auto type : FloatingPointTypes()) { |
| 62 | options_.lower_limit = 0.25; |
| 63 | options_.upper_limit = 0.75; |
| 64 | CheckWinsorize(type, "[]", "[]"); |
| 65 | CheckWinsorize(type, "[null, null]", "[null, null]"); |
| 66 | CheckWinsorize(type, "[1.1, 2.2, 3.3, 44, 55]", "[2.2, 2.2, 3.3, 44, 44]"); |
| 67 | CheckWinsorize(type, "[2.2, 1.1, 44, 55, 3.3]", "[2.2, 2.2, 44, 44, 3.3]"); |
| 68 | CheckWinsorize(type, "[2.2, 1.1, null, null, 44, 55, 3.3]", |
| 69 | "[2.2, 2.2, null, null, 44, 44, 3.3]"); |
| 70 | CheckWinsorize(type, "[2.2, 1.1, null, null, NaN, 44, 55, 3.3]", |
| 71 | "[2.2, 2.2, null, null, NaN, 44, 44, 3.3]"); |
| 72 | // Chunked |
| 73 | CheckWinsorizeChunked(type, {"[2.2, 1.1, null]", "[]", "[NaN, 44, 55, 3.3]"}, |
| 74 | {"[2.2, 2.2, null]", "[]", "[NaN, 44, 44, 3.3]"}); |
| 75 | CheckWinsorizeChunked(type, {"[]", "[]"}, {"[]", "[]"}); |
| 76 | CheckWinsorize(ChunkedArrayFromJSON(type, {}), ChunkedArrayFromJSON(type, {})); |
| 77 | |
| 78 | options_.lower_limit = 0.05; |
| 79 | CheckWinsorize(type, "[2.2, 1.1, 44, 55, 3.3]", "[2.2, 1.1, 44, 44, 3.3]"); |
| 80 | options_.upper_limit = 0.95; |
| 81 | CheckWinsorize(type, "[2.2, 1.1, 44, 55, 3.3]", "[2.2, 1.1, 44, 55, 3.3]"); |
| 82 | options_.lower_limit = 0; |
| 83 | options_.upper_limit = 1; |
| 84 | CheckWinsorize(type, "[2.2, 1.1, 44, 55, 3.3]", "[2.2, 1.1, 44, 55, 3.3]"); |
| 85 | options_.lower_limit = options_.upper_limit = 0.5; |
| 86 | CheckWinsorize(type, "[2.2, 1.1, 44, 55, 3.3]", "[3.3, 3.3, 3.3, 3.3, 3.3]"); |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | TEST_F(TestWinsorize, SlicedInput) { |
| 91 | options_.lower_limit = 0.0; |
nothing calls this directly
no test coverage detected