[Groonga-commit] groonga/groonga [master] test: fix the regex expression to parse added pattern

Back to archive index

null+****@clear***** null+****@clear*****
2012年 6月 8日 (金) 13:05:21 JST


HAYASHI Kentaro	2012-06-08 13:05:21 +0900 (Fri, 08 Jun 2012)

  New Revision: 10b479982081c96ec9698533fb0897ae4d8ee0c9

  Log:
    test: fix the regex expression to parse added pattern

  Modified files:
    test/benchmark/geo-distance-summary.rb

  Modified: test/benchmark/geo-distance-summary.rb (+5 -12)
===================================================================
--- test/benchmark/geo-distance-summary.rb    2012-06-08 09:39:13 +0900 (87b6502)
+++ test/benchmark/geo-distance-summary.rb    2012-06-08 13:05:21 +0900 (5a02434)
@@ -72,18 +72,11 @@ class BenchmarkSummary
       File.open(log, "r") do |file|
         data = file.read
         entry = {}
-        data =~ /(rectangular \(WGS84\)): \((.+)\)\n/
-        entry[$1] = $2.to_f
-        data =~ /(rectangular \(TOKYO\)): \((.+)\)\n/
-        entry[$1] = $2.to_f
-        data =~ /(spherical \(WGS84\)): \((.+)\)\n/
-        entry[$1] = $2.to_f
-        data =~ /(spherical \(TOKYO\)): \((.+)\)\n/
-        entry[$1] = $2.to_f
-        data =~ /(hubeny \(WGS84\)): \((.+)\)\n/
-        entry[$1] = $2.to_f
-        data =~ /(hubeny \(TOKYO\)): \((.+)\)\n/
-        entry[$1] = $2.to_f
+        data.split("\n").each do |line|
+          if line =~ /\s*(.+?):\s+\((.+)\)/
+            entry[$1] = $2.to_f
+          end
+        end
         parse_result[index] = entry
       end
     end




Groonga-commit メーリングリストの案内
Back to archive index