@@ -39,4 +39,31 @@ def test_to_c
3939 assert_send_type '() -> Complex' , 1.0 , :to_c
4040 assert_send_type '() -> Complex' , 1 r, :to_c
4141 end
42+
43+ def test_step
44+ assert_send_type '() -> Enumerator::ArithmeticSequence' ,
45+ 1 , :step
46+ assert_send_type '() { (Integer) -> void } -> Integer' ,
47+ 1 , :step do |i | break_from_block i end
48+ assert_send_type '(Float) -> Enumerator::ArithmeticSequence' ,
49+ 1 , :step , 1.5
50+ assert_send_type '(Float) { (Float) -> void } -> Integer' ,
51+ 1 , :step , 1.5 do |i | break_from_block i end
52+ assert_send_type '(Integer, Float) -> Enumerator::ArithmeticSequence' ,
53+ 1 r, :step , 2 , 0.2
54+ assert_send_type '(Integer, Float) { (Float) -> void } -> Rational' ,
55+ 1 r, :step , 2 , 0.2 do |i | end
56+ assert_send_type '(to: Rational) -> Enumerator::ArithmeticSequence' ,
57+ 1 , :step , to : 2 r
58+ assert_send_type '(to: Rational) { (Integer) -> void } -> Integer' ,
59+ 1 , :step , to : 2 r do |i | end
60+ assert_send_type '(by: Float) -> Enumerator::ArithmeticSequence' ,
61+ 1 , :step , by : 0.2
62+ assert_send_type '(by: Float) { (Float) -> void } -> Rational' ,
63+ 1 , :step , by : 0.2 do |i | break_from_block i end
64+ assert_send_type '(to: Rational, by: Float) -> Enumerator::ArithmeticSequence' ,
65+ 1 , :step , to : 3 r, by : 0.2
66+ assert_send_type '(to: Rational, by: Float) { (Float) -> void } -> Rational' ,
67+ 1 , :step , to : 3 r, by : 0.2 do |i | break_from_block i end
68+ end
4269end
0 commit comments