aboutsummaryrefslogtreecommitdiffstats
path: root/test/prism/heredoc_dedent_test.rb
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2023-10-17 11:45:49 -0400
committergit <svn-admin@ruby-lang.org>2023-10-18 16:09:16 +0000
commit8210cc4218b639b699c73ac273b62422d5718e10 (patch)
tree921cdeb6a614fb703e7cc3187ce8546b698ba9b1 /test/prism/heredoc_dedent_test.rb
parentc82b10bbc3a3293ba9464c27ac5e778c70d2fe9b (diff)
downloadruby-8210cc4218b639b699c73ac273b62422d5718e10.tar.gz
[ruby/prism] Fix lex compat when dedent should be 0
https://github.com/ruby/prism/commit/41c0e0e06e
Diffstat (limited to 'test/prism/heredoc_dedent_test.rb')
-rw-r--r--test/prism/heredoc_dedent_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/prism/heredoc_dedent_test.rb b/test/prism/heredoc_dedent_test.rb
index 1943235731..9fbc4d936a 100644
--- a/test/prism/heredoc_dedent_test.rb
+++ b/test/prism/heredoc_dedent_test.rb
@@ -7,8 +7,13 @@ module Prism
filepath = File.expand_path("fixtures/tilde_heredocs.txt", __dir__)
File.read(filepath).split(/(?=\n)\n(?=<)/).each_with_index do |heredoc, index|
+ # The first example in this file has incorrect dedent calculated by
+ # TruffleRuby so we skip it.
+ next if index == 0 && RUBY_ENGINE == "truffleruby"
+
define_method "test_heredoc_#{index}" do
node = Prism.parse(heredoc).value.statements.body.first
+
if node.is_a?(StringNode)
actual = node.unescaped
else