| 126 | } |
| 127 | |
| 128 | void AssertJSONDictArray(const std::shared_ptr<DataType>& index_type, |
| 129 | const std::shared_ptr<DataType>& value_type, |
| 130 | const std::string& json, |
| 131 | const std::string& expected_indices_json, |
| 132 | const std::string& expected_values_json) { |
| 133 | auto type = dictionary(index_type, value_type); |
| 134 | |
| 135 | ASSERT_OK_AND_ASSIGN(auto expected_indices, |
| 136 | ArrayFromJSONString(index_type, expected_indices_json)); |
| 137 | ASSERT_OK_AND_ASSIGN(auto expected_values, |
| 138 | ArrayFromJSONString(value_type, expected_values_json)); |
| 139 | |
| 140 | ASSERT_OK_AND_ASSIGN(auto actual, ArrayFromJSONString(type, json)); |
| 141 | ASSERT_OK(actual->ValidateFull()); |
| 142 | |
| 143 | const auto& dict_array = checked_cast<const DictionaryArray&>(*actual); |
| 144 | AssertArraysEqual(*expected_indices, *dict_array.indices()); |
| 145 | AssertArraysEqual(*expected_values, *dict_array.dictionary()); |
| 146 | } |
| 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, |
no test coverage detected