Skip to content

Commit d39675d

Browse files
committed
Fix to be explicit, including patterns return nil
1 parent a2e7683 commit d39675d

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

test/stdlib/MatchData_test.rb

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,27 @@ def test_initalize_copy
2323

2424
def test_bytebegin
2525
if_ruby("3.4"...) do
26-
with_backref do |backref|
27-
assert_send_type '(MatchData::capture) -> Integer',
28-
INSTANCE, :bytebegin, backref
29-
assert_send_type '(MatchData::capture) -> Integer',
30-
INSTANCE2, :bytebegin, backref
31-
end
26+
assert_send_type '(String) -> Integer',
27+
INSTANCE, :bytebegin, 'a'
28+
assert_send_type '(Symbol) -> Integer',
29+
INSTANCE, :bytebegin, :a
30+
assert_send_type '(Integer) -> Integer',
31+
INSTANCE2, :bytebegin, 0
32+
assert_send_type '(Integer) -> nil',
33+
INSTANCE2, :bytebegin, 1
3234
end
3335
end
3436

3537
def test_byteend
3638
if_ruby("3.4"...) do
37-
with_backref do |backref|
38-
assert_send_type '(MatchData::capture) -> Integer',
39-
INSTANCE, :byteend, backref
40-
assert_send_type '(MatchData::capture) -> Integer',
41-
INSTANCE2, :byteend, backref
42-
end
39+
assert_send_type '(String) -> Integer',
40+
INSTANCE, :byteend, 'a'
41+
assert_send_type '(Symbol) -> Integer',
42+
INSTANCE, :byteend, :a
43+
assert_send_type '(Integer) -> Integer',
44+
INSTANCE2, :byteend, 0
45+
assert_send_type '(Integer) -> nil',
46+
INSTANCE2, :byteend, 1
4347
end
4448
end
4549

0 commit comments

Comments
 (0)