We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36cd985 commit 480080bCopy full SHA for 480080b
test/stringio/test_stringio.rb
@@ -1064,6 +1064,20 @@ def test_coderange_after_overwrite
1064
assert_predicate(s.string, :ascii_only?)
1065
end
1066
1067
+ def test_coderange_after_read_into_buffer
1068
+ s = StringIO.new("01234567890".b)
1069
+
1070
+ buf = "¿Cómo estás? Ça va bien?"
1071
+ assert_not_predicate(buf, :ascii_only?)
1072
1073
+ assert_predicate(s.string, :ascii_only?)
1074
1075
+ s.read(10, buf)
1076
1077
+ assert_predicate(buf, :ascii_only?)
1078
+ assert_equal '0123456789', buf
1079
+ end
1080
1081
require "objspace"
1082
if ObjectSpace.respond_to?(:dump) && ObjectSpace.dump(eval(%{"test"})).include?('"chilled":true') # Ruby 3.4+ chilled strings
1083
def test_chilled_string
0 commit comments