diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-08 08:25:21 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-08 08:25:21 +0000 |
commit | 18c9bf5de3380c13d94b7e85f5daf739df30894a (patch) | |
tree | 37aec639e17ca58d404624a5f2594a447d27aea7 /test | |
parent | ea07884a413f62348a47a574b1818555271f6d96 (diff) | |
download | ruby-18c9bf5de3380c13d94b7e85f5daf739df30894a.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.rb | 4 |
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 |