MCPcopy Create free account
hub / github.com/apache/arrow / TestNulls

Method TestNulls

cpp/src/arrow/csv/converter_test.cc:182–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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();

Callers 1

TYPED_TESTFunction · 0.80

Calls 2

typeMethod · 0.95
DefaultsFunction · 0.50

Tested by

no test coverage detected