| 20 | include Helper::Omittable |
| 21 | |
| 22 | def test_int32 |
| 23 | array = build_int32_array([1, 3, 1, -1, -3, -1]) |
| 24 | fields = [ |
| 25 | Arrow::Field.new("values", Arrow::Int32DataType.new), |
| 26 | Arrow::Field.new("counts", Arrow::Int64DataType.new), |
| 27 | ] |
| 28 | structs = [ |
| 29 | {"values" => 1, "counts" => 2}, |
| 30 | {"values" => 3, "counts" => 1}, |
| 31 | {"values" => -1, "counts" => 2}, |
| 32 | {"values" => -3, "counts" => 1}, |
| 33 | ] |
| 34 | assert_equal(build_struct_array(fields, structs), |
| 35 | array.count_values) |
| 36 | end |
| 37 | |
| 38 | def test_string |
| 39 | array = build_string_array(["Ruby", "Python", "Ruby"]) |