| 177 | |
| 178 | template <typename Encoder, typename DfTest> |
| 179 | void TestOrdinalEncoderEmpty() { |
| 180 | auto sol = std::vector<std::int32_t>{0, 3, 1}; |
| 181 | Encoder encoder; |
| 182 | auto df = DfTest::Make(DfTest::MakeInts(), DfTest::MakeStrs("cbd", "bbd", "dbd", "ab"), |
| 183 | DfTest::MakeInts()); |
| 184 | auto orig_dict = df.View(); |
| 185 | |
| 186 | auto new_df = |
| 187 | DfTest::Make(DfTest::MakeInts(), DfTest::MakeStrs("cbd", "ab", "bbd"), DfTest::MakeInts()); |
| 188 | auto new_dict = new_df.View(); |
| 189 | encoder.Recode(orig_dict, new_dict, new_df.MappingView()); |
| 190 | ASSERT_EQ(new_df.Mapping().size(), 3); |
| 191 | ASSERT_EQ(new_df.Mapping(), sol); |
| 192 | } |
| 193 | } // namespace enc |
nothing calls this directly
no test coverage detected