From 18cf70ebf636b9754760b12961bebb125af6ec39 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 3 Aug 2016 12:31:25 +0000 Subject: 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 --- test/ripper/test_ripper.rb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'test/ripper/test_ripper.rb') diff --git a/test/ripper/test_ripper.rb b/test/ripper/test_ripper.rb index 7631b91042..afe7183ff4 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}) -%> + +
+

\u{5bff 9650 7121}

+
+
\u{5bff 9650 7121 3002}
\u{5bff 9650 7121 3002}
+ +
+
+ +
+
<%= @baz %>
+
+
+
+ END + assert_nil(Ripper.sexp(src), bug12651) + end; + end end if ripper_test -- cgit v1.2.3