diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-09-11 16:43:02 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-09-11 17:12:27 +0900 |
commit | 46bde60df31790d1618eabaf3dc5f36931c2acaf (patch) | |
tree | a53d996d3921ae4e88ec71e5de0d0e945cd8f49b /tool/lib | |
parent | 0fbde94b27d9ed08c96944717bf7bfa76897276e (diff) | |
download | ruby-46bde60df31790d1618eabaf3dc5f36931c2acaf.tar.gz |
Remove method filter hack for minitest
Diffstat (limited to 'tool/lib')
-rw-r--r-- | tool/lib/test/unit.rb | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/tool/lib/test/unit.rb b/tool/lib/test/unit.rb index a8c4a93b0f..94867accdf 100644 --- a/tool/lib/test/unit.rb +++ b/tool/lib/test/unit.rb @@ -172,13 +172,6 @@ module Test negative = Regexp.union(*negative.map! {|s| Regexp.new(s[neg_pat, 1])}) filter = /\A(?=.*#{filter})(?!.*#{negative})/ end - if Regexp === filter - filter = filter.dup - # bypass conversion in minitest - def filter.=~(other) # :nodoc: - super unless Regexp === other - end - end options[:filter] = filter end true @@ -1371,22 +1364,21 @@ module Test header = "#{type}_suite_header" puts send(header, suite) if respond_to? header - filter = options[:filter] || '/./' - filter = Regexp.new $1 if filter =~ /\/(.*)\// + filter = options[:filter] all_test_methods = suite.send "#{type}_methods" - filtered_test_methods = all_test_methods.find_all { |m| - filter === m || filter === "#{suite}##{m}" - } - leakchecker = LeakChecker.new if ENV["LEAK_CHECKER_TRACE_OBJECT_ALLOCATION"] require "objspace" trace = true end - assertions = filtered_test_methods.map { |method| + assertions = all_test_methods.filter_map { |method| + if filter + next unless filter === method || filter === "#{suite}##{method}" + end + inst = suite.new method inst._assertions = 0 |