{ext,test}/zlib: Specify frozen_string_literal: true.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kazu 2017-02-07 12:49:57 +00:00
parent 7511130721
commit 026ded9384
2 changed files with 10 additions and 10 deletions

View File

@ -1,4 +1,4 @@
# frozen_string_literal: false # frozen_string_literal: true
# #
# extconf.rb # extconf.rb
# #

View File

@ -1,5 +1,5 @@
# coding: us-ascii # coding: us-ascii
# frozen_string_literal: false # frozen_string_literal: true
require 'test/unit' require 'test/unit'
require 'stringio' require 'stringio'
require 'tempfile' require 'tempfile'
@ -42,7 +42,7 @@ if defined? Zlib
end end
def test_deflate_chunked def test_deflate_chunked
original = '' original = ''.dup
chunks = [] chunks = []
r = Random.new 0 r = Random.new 0
@ -315,7 +315,7 @@ if defined? Zlib
z = Zlib::Inflate.new z = Zlib::Inflate.new
inflated = "" inflated = "".dup
deflated.each_char do |byte| deflated.each_char do |byte|
inflated << z.inflate(byte) inflated << z.inflate(byte)
@ -603,7 +603,7 @@ if defined? Zlib
assert_equal(t.path, f.path) assert_equal(t.path, f.path)
end end
s = "" s = "".dup
sio = StringIO.new(s) sio = StringIO.new(s)
gz = Zlib::GzipWriter.new(sio) gz = Zlib::GzipWriter.new(sio)
gz.print("foo") gz.print("foo")
@ -625,7 +625,7 @@ if defined? Zlib
end end
def test_ungetc def test_ungetc
s = "" s = "".dup
w = Zlib::GzipWriter.new(StringIO.new(s)) w = Zlib::GzipWriter.new(StringIO.new(s))
w << (1...1000).to_a.inspect w << (1...1000).to_a.inspect
w.close w.close
@ -640,7 +640,7 @@ if defined? Zlib
end end
def test_ungetc_paragraph def test_ungetc_paragraph
s = "" s = "".dup
w = Zlib::GzipWriter.new(StringIO.new(s)) w = Zlib::GzipWriter.new(StringIO.new(s))
w << "abc" w << "abc"
w.close w.close
@ -778,7 +778,7 @@ if defined? Zlib
end end
Zlib::GzipReader.open(t.path) do |f| Zlib::GzipReader.open(t.path) do |f|
s = "" s = "".dup
f.readpartial(3, s) f.readpartial(3, s)
assert("foo".start_with?(s)) assert("foo".start_with?(s))
@ -938,7 +938,7 @@ if defined? Zlib
end end
def test_corrupted_header def test_corrupted_header
gz = Zlib::GzipWriter.new(StringIO.new(s = "")) gz = Zlib::GzipWriter.new(StringIO.new(s = "".dup))
gz.orig_name = "X" gz.orig_name = "X"
gz.comment = "Y" gz.comment = "Y"
gz.print("foo") gz.print("foo")
@ -1120,7 +1120,7 @@ if defined? Zlib
def test_deflate_stream def test_deflate_stream
r = Random.new 0 r = Random.new 0
deflated = '' deflated = ''.dup
Zlib.deflate(r.bytes(20000)) do |chunk| Zlib.deflate(r.bytes(20000)) do |chunk|
deflated << chunk deflated << chunk