Skip to content

Commit 819bdf0

Browse files
committed
Add tests for caller_locations
1 parent 9116235 commit 819bdf0

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

test/stdlib/Kernel_test.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@ class KernelSingletonTest < Test::Unit::TestCase
77

88
testing "singleton(::Kernel)"
99

10+
def test_caller_locations
11+
assert_send_type "() -> Array[Thread::Backtrace::Location]",
12+
Kernel, :caller_locations
13+
14+
assert_send_type "(Integer) -> Array[Thread::Backtrace::Location]?",
15+
Kernel, :caller_locations, 1
16+
17+
assert_send_type "(Integer, Integer) -> Array[Thread::Backtrace::Location]?",
18+
Kernel, :caller_locations, 1, 2
19+
20+
assert_send_type "(::Range[Integer]) -> Array[Thread::Backtrace::Location]?",
21+
Kernel, :caller_locations, (1..3)
22+
end
23+
1024
def test_Array
1125
assert_send_type "(nil) -> []",
1226
Kernel, :Array, nil

0 commit comments

Comments
 (0)