1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test_string.rb: yet another test

* test/ruby/test_string.rb (TestString#test_frozen_string_adjacent):
  option is allowed after the last string.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-09-02 14:56:03 +00:00
parent 306cf3ac03
commit a94833eb50

View file

@ -2225,6 +2225,17 @@ class TestString < Test::Unit::TestCase
assert_equal "2", f.call
end
def test_frozen_string_adjacent
str = nil
assert_nothing_raised(SyntaxError) do
eval(%{
str = "hello" "world"f
})
end
assert_equal "helloworld", str
assert_predicate str, :frozen?
end
def test_frozen_string_cannot_be_adjacent
assert_raise(SyntaxError) do
eval(%{