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

Class TimestampArrayTest

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

Source from the content-addressed store, hash-verified

16# under the License.
17
18class TimestampArrayTest < Test::Unit::TestCase
19 test("#[]") do
20 sec = 1513267750
21 usec = 914509
22 array = Arrow::TimestampArray.new(:micro, [sec * (10 ** 6) + usec])
23 time = Time.at(sec, usec)
24 assert_equal(time, array[0])
25 end
26
27 sub_test_case("#is_in") do
28 def setup
29 values = [
30 Time.parse("2019-11-18T00:09:11"),
31 Time.parse("2019-11-18T00:09:12"),
32 Time.parse("2019-11-18T00:09:13"),
33 ]
34 @array = Arrow::TimestampArray.new(:micro, values)
35 end
36
37 test("Arrow: Array") do
38 right = [
39 Time.parse("2019-11-18T00:09:12"),
40 ]
41 assert_equal(Arrow::BooleanArray.new([false, true, false]),
42 @array.is_in(right))
43 end
44 end
45end

Callers

nothing calls this directly

Calls 4

testFunction · 0.85
newMethod · 0.45
parseMethod · 0.45
is_inMethod · 0.45

Tested by

no test coverage detected