Skip to content

Commit 01219ce

Browse files
committed
add tests for thread aliasing
Covering commit 0d291b5.
1 parent 0d291b5 commit 01219ce

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test-base/inspect_test.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,26 @@ def test_inspect_error_2
5858
send_cont
5959
end
6060

61+
def test_inspect_expr_with_timeout
62+
create_socket ["require 'timeout'", "puts 'test'"]
63+
run_to_line(2)
64+
send_ruby("v inspect (Timeout::timeout(10) { nil })")
65+
variables = read_variables
66+
assert_equal(1, variables.length, "There is one variable returned which is nil.")
67+
assert_equal(nil, variables[0].value)
68+
send_cont
69+
end
70+
71+
def test_inspect_failing_expr_with_timeout
72+
create_socket ["require 'timeout'", "puts 'test'"]
73+
run_to_line(2)
74+
send_ruby("v inspect (Timeout::timeout(0.1) { sleep 0.2 })")
75+
variables = read_variables
76+
assert_equal(1, variables.length, "There is one variable returned which is nil.")
77+
assert_equal("Timeout::Error", variables[0].type)
78+
send_cont
79+
end
80+
6181
def test_inspect_multiline_expression
6282
create_socket ["sleep 0.1"]
6383
run_to_line(1)

0 commit comments

Comments
 (0)