| 180 | std::shared_ptr<DataType> type() { return TypeTraits<T>::type_singleton(); } |
| 181 | |
| 182 | void TestNulls() { |
| 183 | auto type = this->type(); |
| 184 | AssertConversion<T, std::string>(type, {"ab,N/A\n", "NULL,\n"}, |
| 185 | {{"ab", "NULL"}, {"N/A", ""}}, |
| 186 | {{true, true}, {true, true}}); |
| 187 | |
| 188 | auto options = ConvertOptions::Defaults(); |
| 189 | options.strings_can_be_null = true; |
| 190 | AssertConversion<T, std::string>(type, {"ab,N/A\n", "NULL,\n"}, |
| 191 | {{"ab", ""}, {"", ""}}, |
| 192 | {{true, false}, {false, false}}, options); |
| 193 | AssertConversion<T, std::string>(type, {"ab,\"N/A\"\n", "\"NULL\",\"\"\n"}, |
| 194 | {{"ab", ""}, {"", ""}}, |
| 195 | {{true, false}, {false, false}}, options); |
| 196 | options.quoted_strings_can_be_null = false; |
| 197 | AssertConversion<T, std::string>(type, {"ab,N/A\n", "NULL,\n"}, |
| 198 | {{"ab", ""}, {"", ""}}, |
| 199 | {{true, false}, {false, false}}, options); |
| 200 | AssertConversion<T, std::string>(type, {"ab,\"N/A\"\n", "\"NULL\",\"\"\n"}, |
| 201 | {{"ab", "NULL"}, {"N/A", ""}}, |
| 202 | {{true, true}, {true, true}}, options); |
| 203 | } |
| 204 | |
| 205 | void TestCustomNulls() { |
| 206 | auto type = this->type(); |
no test coverage detected