[Groonga-commit] groonga/grntest [master] Extract raw output normalization code

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Aug 14 14:59:47 JST 2012


Kouhei Sutou	2012-08-14 14:59:47 +0900 (Tue, 14 Aug 2012)

  New Revision: fd04225cbe7632d36832f695215f27cd5458e505
  https://github.com/groonga/grntest/commit/fd04225cbe7632d36832f695215f27cd5458e505

  Log:
    Extract raw output normalization code

  Modified files:
    lib/grntest/tester.rb

  Modified: lib/grntest/tester.rb (+7 -4)
===================================================================
--- lib/grntest/tester.rb    2012-08-14 14:57:14 +0900 (1a31e1d)
+++ lib/grntest/tester.rb    2012-08-14 14:59:47 +0900 (f7a93cd)
@@ -938,12 +938,16 @@ EOF
           when :output
             normalized_result << normalize_output(content, options)
           when :error
-            normalized_result << "#{content}\n".force_encoding("ASCII-8BIT")
+            normalized_result << normalize_raw_content(content)
           end
         end
         normalized_result
       end
 
+      def normalize_raw_content(content)
+        "#{content}\n".force_encoding("ASCII-8BIT")
+      end
+
       def normalize_output(content, options)
         type = options[:type]
         case type
@@ -955,10 +959,9 @@ EOF
           if normalized_output.bytesize > @max_n_columns
             normalized_output = JSON.pretty_generate(normalized_output_content)
           end
-          normalized_output.force_encoding("ASCII-8BIT")
-          "#{normalized_output}\n"
+          normalize_raw_content(normalized_output)
         else
-          "#{content}\n".force_encoding("ASCII-8BIT")
+          normalize_raw_content(content)
         end
       end
 
-------------- next part --------------
HTML����������������������������...
Télécharger 



More information about the Groonga-commit mailing list
Back to archive index