summaryrefslogtreecommitdiff
path: root/test/fiddle/test_import.rb
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-12 23:15:34 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-12 23:15:34 +0000
commit3fe69a0da484c277c4bcfc07e72e5843d56e83df (patch)
treefd04294b1cd3ea8a9c5edfdca5fbda44530956d8 /test/fiddle/test_import.rb
parent4ef5c754f7a920d4bbad512503f61d473d03a4b7 (diff)
Use mutable strings for mutation tests.
* test/fiddle/test_func.rb (test_string): this test break String buffer by `strcpy` ("000" -> "123"). However, the string literal "000" with `frozen_string_literal: true` returns a string object from frozen string pool. So that after this test "000" from fstring pool becomes "123" (modified string). 'test/date/' uses "000" (as fstring) and tests are fails (we could check with `make test-all TESTS='fiddle date'`). * test/fiddle/test_function.rb: ditto. * test/fiddle/test_import.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/fiddle/test_import.rb')
-rw-r--r--test/fiddle/test_import.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/fiddle/test_import.rb b/test/fiddle/test_import.rb
index 0cd5e76a80..ff16d17d50 100644
--- a/test/fiddle/test_import.rb
+++ b/test/fiddle/test_import.rb
@@ -128,7 +128,7 @@ module Fiddle
end
def test_strcpy()
- buff = "000"
+ buff = +"000"
str = LIBC.strcpy(buff, "123")
assert_equal("123", buff)
assert_equal("123", str.to_s)