mirror of
https://github.com/ruby/ruby.git
synced 2025-08-27 15:06:10 +02:00
parent
a295eeba9d
commit
2ab75bc444
6 changed files with 76 additions and 12 deletions
|
@ -231,6 +231,21 @@ module Prism
|
|||
assert_equal 16, base[parse_expression("0x1")]
|
||||
end
|
||||
|
||||
def test_offset
|
||||
source = <<~RUBY
|
||||
#!/bin/sh
|
||||
|
||||
echo "foo"
|
||||
exit 0
|
||||
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
puts "bar"
|
||||
RUBY
|
||||
|
||||
assert Prism.parse_success?(source, offset: 30)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def parse_expression(source)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue