MCPcopy Create free account
hub / github.com/apache/arrow / ArrayTest

Class ArrayTest

ruby/red-arrow/test/test-array.rb:18–332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16# under the License.
17
18class ArrayTest < Test::Unit::TestCase
19 sub_test_case(".new") do
20 test("Boolean") do
21 array = Arrow::BooleanArray.new([true, false, true])
22 assert_equal([true, false, true],
23 array.to_a)
24 end
25 end
26
27 sub_test_case("instance methods") do
28 def setup
29 @values = [true, false, nil, true]
30 @array = Arrow::BooleanArray.new(@values)
31 end
32
33 test("#each") do
34 assert_equal(@values, @array.to_a)
35 end
36
37 sub_test_case("#[]") do
38 test("valid range") do
39 assert_equal(@values,
40 @array.length.times.collect {|i| @array[i]})
41 end
42
43 test("out of range") do
44 assert_nil(@array[@array.length])
45 end
46
47 test("negative index") do
48 assert_equal(@values.last,
49 @array[-1])
50 end
51 end
52
53 sub_test_case("#==") do
54 test("Arrow::Array") do
55 assert do
56 @array == @array
57 end
58 end
59
60 test("not Arrow::Array") do
61 assert do
62 not (@array == 29)
63 end
64 end
65 end
66
67 sub_test_case("#equal_array?") do
68 test("no options") do
69 array1 = Arrow::FloatArray.new([1.1, Float::NAN])
70 array2 = Arrow::FloatArray.new([1.1, Float::NAN])
71 assert do
72 not array1.equal_array?(array2)
73 end
74 end
75

Callers

nothing calls this directly

Calls 12

testFunction · 0.85
equal_array?Method · 0.80
filterMethod · 0.80
newMethod · 0.45
to_aMethod · 0.45
lengthMethod · 0.45
castMethod · 0.45
takeMethod · 0.45
is_inMethod · 0.45
concatenateMethod · 0.45
resolveMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected