summaryrefslogtreecommitdiff
path: root/test/ripper/test_ripper.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-03 12:31:25 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-03 12:31:25 +0000
commit18cf70ebf636b9754760b12961bebb125af6ec39 (patch)
treed35f49337331491b60b3f1a02c2b7eba2e37e1c8 /test/ripper/test_ripper.rb
parent340805cfad9ca5072ab79cdbc1cf00b98c764caf (diff)
parse.y: reg_fragment_enc_error
* parse.y (reg_fragment_enc_error): compile_error is different between parser and ripper. [ruby-core:76397] [Bug #12651] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ripper/test_ripper.rb')
-rw-r--r--test/ripper/test_ripper.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/ripper/test_ripper.rb b/test/ripper/test_ripper.rb
index 7631b91..afe7183 100644
--- a/test/ripper/test_ripper.rb
+++ b/test/ripper/test_ripper.rb
@@ -72,4 +72,30 @@ class TestRipper::Ripper < Test::Unit::TestCase
ripper.parse
assert_not_predicate(ripper, :error?, bug11932)
end
+
+ def test_regexp_enc_error
+ assert_separately(%w[-rripper], "#{<<-"begin;"}\n#{<<-"end;"}")
+ begin;
+ bug12651 = '[ruby-core:76397] [Bug #12651]'
+ src = <<-END
+<%- @title = '\u{5bff 9650 7121}' -%>
+<%- content_for :foo, render(partial: 'bar', locals: {baz: 2}) -%>
+
+<div class="dead beef">
+ <h2 class="dead beef">\u{5bff 9650 7121}</h2>
+</div>
+<div class="dead beef">\u{5bff 9650 7121 3002}<br class="dead beef">\u{5bff 9650 7121 3002}</div>
+
+<div class="dead beef">
+ <div class="dead beef">
+ <label class="dead beef">\u{5bff 9650 7121}</label>
+ <div class="dead beef">
+ <div class="dead beef"><%= @baz %></div>
+ </div>
+ </div>
+</div>
+ END
+ assert_nil(Ripper.sexp(src), bug12651)
+ end;
+ end
end if ripper_test