summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2024-03-11 10:09:10 -0400
committergit <svn-admin@ruby-lang.org>2024-03-11 14:49:23 +0000
commit2ab75bc44486b3afcd7ccb060120e12c2fa17217 (patch)
treeb2cbbe00f385cc8e8ec154655b29fbe4c74bee21 /test
parenta295eeba9d013ab3863a3e5e339e170332e9be9f (diff)
[ruby/prism] Support offset
https://github.com/ruby/prism/commit/665f533373
Diffstat (limited to 'test')
-rw-r--r--test/prism/ruby_api_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/prism/ruby_api_test.rb b/test/prism/ruby_api_test.rb
index ff69ef5417..80f7cb05d3 100644
--- a/test/prism/ruby_api_test.rb
+++ b/test/prism/ruby_api_test.rb
@@ -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)