[Groonga-commit] droonga/drntest at ced85a6 [master] Create Regexp on command parsing

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Nov 25 23:34:19 JST 2013


Kouhei Sutou	2013-11-25 23:34:19 +0900 (Mon, 25 Nov 2013)

  New Revision: ced85a6b28b9a73bda4946a1f5b1181c08be3612
  https://github.com/droonga/drntest/commit/ced85a6b28b9a73bda4946a1f5b1181c08be3612

  Message:
    Create Regexp on command parsing

  Modified files:
    lib/drntest/tester.rb

  Modified: lib/drntest/tester.rb (+4 -6)
===================================================================
--- lib/drntest/tester.rb    2013-11-25 23:33:05 +0900 (850544a)
+++ lib/drntest/tester.rb    2013-11-25 23:34:19 +0900 (403cbc4)
@@ -71,6 +71,9 @@ module Drntest
 
         parser.on("--test=PATTERN",
                   "Run only tests which have a name matched to the given PATTERN") do |pattern|
+          if pattern =~ /\A\/.+\/\z/
+            pattern = Regexp.new(pattern[1..-2])
+          end
           tester.pattern = pattern
         end
 
@@ -128,13 +131,8 @@ module Drntest
       end
 
       unles****@patte*****?
-        if @pattern =~ /\A\/.+\/\z/
-          matcher = Regexp.new(@pattern[1..-2])
-        else
-          matcher = @pattern
-        end
         tests.select! do |test|
-          matcher === test.basename(".test").to_s
+          @pattern === test.basename(".test").to_s
         end
       end
 
-------------- next part --------------
HTML����������������������������...
Download 



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