summaryrefslogtreecommitdiff
path: root/test/ripper
diff options
context:
space:
mode:
authorcharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-02 07:11:41 +0000
committercharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-02 07:11:41 +0000
commita056098cb719312452eca309bec914406f9e5ca3 (patch)
tree36680bbcdabc53cd0a4132996d2b8984eaaa945d /test/ripper
parent78c75d91ae577df2c43ba5b41891572d75105b2d (diff)
* NEWS: Add note about frozen string literals
* compile.c (case_when_optimizable_literal): optimize NODE_LIT strings in when clauses of case statements * ext/ripper/eventids2.c: add tSTRING_SUFFIX * parse.y: add 'f' suffix on string literals for frozen strings * test/ripper/test_scanner_events.rb: add scanner tests * test/ruby/test_string.rb: add frozen string tests [Feature #8579] [ruby-core:55699] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ripper')
-rw-r--r--test/ripper/test_scanner_events.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ripper/test_scanner_events.rb b/test/ripper/test_scanner_events.rb
index 2474588..3eed357 100644
--- a/test/ripper/test_scanner_events.rb
+++ b/test/ripper/test_scanner_events.rb
@@ -591,6 +591,15 @@ class TestRipper::ScannerEvents < Test::Unit::TestCase
scan('tstring_end', '%Q[abcdef]')
end
+ def test_tstring_suffix
+ assert_equal ['"f'],
+ scan('tstring_end', '"abcdef"f')
+ assert_equal [']f'],
+ scan('tstring_end', '%q[abcdef]f')
+ assert_equal [']f'],
+ scan('tstring_end', '%Q[abcdef]f')
+ end
+
def test_regexp_beg
assert_equal [],
scan('regexp_beg', '')