| 147 | |
| 148 | template <typename T, typename C_TYPE = typename T::c_type> |
| 149 | void AssertJSONScalar(const std::shared_ptr<DataType>& type, const std::string& json, |
| 150 | const bool is_valid, const C_TYPE value) { |
| 151 | SCOPED_TRACE(json); |
| 152 | std::shared_ptr<Scalar> expected; |
| 153 | |
| 154 | ASSERT_OK_AND_ASSIGN(auto actual, ScalarFromJSONString(type, json)); |
| 155 | if (is_valid) { |
| 156 | ASSERT_OK_AND_ASSIGN(expected, MakeScalar(type, value)); |
| 157 | } else { |
| 158 | expected = MakeNullScalar(type); |
| 159 | } |
| 160 | AssertScalarsEqual(*expected, *actual, /*verbose=*/true); |
| 161 | } |
| 162 | |
| 163 | TEST(TestHelper, JSONArray) { |
| 164 | // Test the JSONArray helper func |
nothing calls this directly
no test coverage detected