| 128 | } // namespace |
| 129 | |
| 130 | TEST(InversePermutation, InvalidOutputType) { |
| 131 | { |
| 132 | ARROW_SCOPED_TRACE("Output type unsigned"); |
| 133 | auto indices = ArrayFromJSON(int32(), "[]"); |
| 134 | ASSERT_RAISES_WITH_MESSAGE( |
| 135 | TypeError, |
| 136 | "Type error: Output type of inverse_permutation must be signed integer, got " |
| 137 | "uint32", |
| 138 | InversePermutation(indices, /*max_index=*/0, /*output_type=*/uint32())); |
| 139 | } |
| 140 | { |
| 141 | ARROW_SCOPED_TRACE("Output type float"); |
| 142 | auto indices = ArrayFromJSON(int32(), "[]"); |
| 143 | ASSERT_RAISES_WITH_MESSAGE( |
| 144 | TypeError, |
| 145 | "Type error: Output type of inverse_permutation must be signed integer, got " |
| 146 | "float", |
| 147 | InversePermutation(indices, /*max_index=*/0, /*output_type=*/float32())); |
| 148 | } |
| 149 | { |
| 150 | ARROW_SCOPED_TRACE("Output type string"); |
| 151 | auto indices = ArrayFromJSON(int32(), "[]"); |
| 152 | ASSERT_RAISES_WITH_MESSAGE( |
| 153 | TypeError, |
| 154 | "Type error: Output type of inverse_permutation must be signed integer, got " |
| 155 | "string", |
| 156 | InversePermutation(indices, /*max_index=*/0, /*output_type=*/utf8())); |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | TEST(InversePermutation, DefaultOptions) { |
| 161 | { |
nothing calls this directly
no test coverage detected