| 16 | # under the License. |
| 17 | |
| 18 | class DictionaryArrayTest < Test::Unit::TestCase |
| 19 | sub_test_case("instance methods") do |
| 20 | def setup |
| 21 | @values = ["a", "b", "c", "b", "a"] |
| 22 | @string_array = Arrow::StringArray.new(@values) |
| 23 | @array = @string_array.dictionary_encode |
| 24 | end |
| 25 | |
| 26 | test("#[]") do |
| 27 | assert_equal(@values, @array.to_a) |
| 28 | end |
| 29 | |
| 30 | test("#get_value") do |
| 31 | assert_equal([ |
| 32 | @values[0], |
| 33 | @values[3], |
| 34 | ], |
| 35 | [ |
| 36 | @array.get_value(0), |
| 37 | @array.get_value(3), |
| 38 | ]) |
| 39 | end |
| 40 | end |
| 41 | end |