aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-08 08:25:21 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-08 08:25:21 +0000
commit7cb988a1baf8d2e7c174c399229812651e439cc7 (patch)
tree37aec639e17ca58d404624a5f2594a447d27aea7 /test
parent062cd5b54ccf7b38a0e196bf9dac800917e00979 (diff)
downloadruby-7cb988a1baf8d2e7c174c399229812651e439cc7.tar.gz
test/unit.rb: fix -n option
* test/lib/test/unit.rb (non_options): turn name patterns into Regexps. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/lib/test/unit.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/lib/test/unit.rb b/test/lib/test/unit.rb
index 2c4a052b6f..9e8a2be848 100644
--- a/test/lib/test/unit.rb
+++ b/test/lib/test/unit.rb
@@ -106,10 +106,10 @@ module Test
elsif negative.empty? and positive.size == 1 and pos_pat !~ positive[0]
filter = positive[0]
else
- filter = Regexp.union(*positive.map! {|s| s[pos_pat, 1] || "\\A#{Regexp.quote(s)}\\z"})
+ filter = Regexp.union(*positive.map! {|s| Regexp.new(s[pos_pat, 1] || "\\A#{Regexp.quote(s)}\\z")})
end
unless negative.empty?
- negative = Regexp.union(*negative.map! {|s| s[neg_pat, 1]})
+ negative = Regexp.union(*negative.map! {|s| Regexp.new(s[neg_pat, 1])})
filter = /\A(?=.*#{filter})(?!.*#{negative})/
end
if Regexp === filter