aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_literal.rb
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-16 12:54:37 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-16 12:54:37 +0000
commit3cd67ce5053aa53133ae9903e572bd81384d8788 (patch)
treeae8d84f29cf5d5cc5ac10fa59c45139611a25619 /test/ruby/test_literal.rb
parent11e078fb04fd6f3f1627ac46db2caaff69c303a8 (diff)
downloadruby-3cd67ce5053aa53133ae9903e572bd81384d8788.tar.gz
* parse.y (parser_read_escape, parser_tokadd_escape): allow a hex or
octal encoded character after \c. This seemed to be prohibited at r13836, but its ChangeLog mentions nothing about this prohibition. So I assume this prohibition is not intended. [ruby-core:27229] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_literal.rb')
-rw-r--r--test/ruby/test_literal.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/ruby/test_literal.rb b/test/ruby/test_literal.rb
index b4480f725a..71fcf49eff 100644
--- a/test/ruby/test_literal.rb
+++ b/test/ruby/test_literal.rb
@@ -54,11 +54,14 @@ class TestRubyLiteral < Test::Unit::TestCase
assert_equal "\n", "\n"
bug2500 = '[ruby-core:27228]'
%w[c C- M-].each do |pre|
- ["u", "x", %w[u{ }]].each do |open, close|
+ ["u", %w[u{ }]].each do |open, close|
str = "\"\\#{pre}\\#{open}5555#{close}\""
assert_raise(SyntaxError, "#{bug2500} eval(#{str})") {eval(str)}
end
end
+ assert_equal "\x13", "\c\x33"
+ assert_equal "\x13", "\C-\x33"
+ assert_equal "\xB3", "\M-\x33"
end
def test_dstring