[前][次][番号順一覧][スレッド一覧]

ruby-changes:45491

From: kazu <ko1@a...>
Date: Tue, 7 Feb 2017 21:50:03 +0900 (JST)
Subject: [ruby-changes:45491] kazu:r57564 (trunk): {ext, test}/zlib: Specify frozen_string_literal: true.

kazu	2017-02-07 21:49:57 +0900 (Tue, 07 Feb 2017)

  New Revision: 57564

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57564

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

  Modified files:
    trunk/ext/zlib/extconf.rb
    trunk/test/zlib/test_zlib.rb
Index: test/zlib/test_zlib.rb
===================================================================
--- test/zlib/test_zlib.rb	(revision 57563)
+++ test/zlib/test_zlib.rb	(revision 57564)
@@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L1
 # coding: us-ascii
-# frozen_string_literal: false
+# frozen_string_literal: true
 require 'test/unit'
 require 'stringio'
 require 'tempfile'
@@ -42,7 +42,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L42
     end
 
     def test_deflate_chunked
-      original = ''
+      original = ''.dup
       chunks = []
       r = Random.new 0
 
@@ -315,7 +315,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L315
 
       z = Zlib::Inflate.new
 
-      inflated = ""
+      inflated = "".dup
 
       deflated.each_char do |byte|
         inflated << z.inflate(byte)
@@ -603,7 +603,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L603
           assert_equal(t.path, f.path)
         end
 
-        s = ""
+        s = "".dup
         sio = StringIO.new(s)
         gz = Zlib::GzipWriter.new(sio)
         gz.print("foo")
@@ -625,7 +625,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L625
     end
 
     def test_ungetc
-      s = ""
+      s = "".dup
       w = Zlib::GzipWriter.new(StringIO.new(s))
       w << (1...1000).to_a.inspect
       w.close
@@ -640,7 +640,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L640
     end
 
     def test_ungetc_paragraph
-      s = ""
+      s = "".dup
       w = Zlib::GzipWriter.new(StringIO.new(s))
       w << "abc"
       w.close
@@ -778,7 +778,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L778
         end
 
         Zlib::GzipReader.open(t.path) do |f|
-          s = ""
+          s = "".dup
           f.readpartial(3, s)
           assert("foo".start_with?(s))
 
@@ -938,7 +938,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L938
     end
 
     def test_corrupted_header
-      gz = Zlib::GzipWriter.new(StringIO.new(s = ""))
+      gz = Zlib::GzipWriter.new(StringIO.new(s = "".dup))
       gz.orig_name = "X"
       gz.comment = "Y"
       gz.print("foo")
@@ -1120,7 +1120,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L1120
     def test_deflate_stream
       r = Random.new 0
 
-      deflated = ''
+      deflated = ''.dup
 
       Zlib.deflate(r.bytes(20000)) do |chunk|
         deflated << chunk
Index: ext/zlib/extconf.rb
===================================================================
--- ext/zlib/extconf.rb	(revision 57563)
+++ ext/zlib/extconf.rb	(revision 57564)
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/ext/zlib/extconf.rb#L1
-# frozen_string_literal: false
+# frozen_string_literal: true
 #
 # extconf.rb
 #

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]