mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Lets consider the following scenario:
~~~
irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):001:0> p suite
OpenSSL::TestEC
=> OpenSSL::TestEC
irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):002:0> p all_test_methods
["test_ECPrivateKey", "test_ECPrivateKey_encrypted", "test_PUBKEY", "test_check_key", "test_derive_key", "test_dh_compute_key", "test_dsa_sign_asn1_FIPS186_3", "test_ec_group", "test_ec_key", "test_ec_point", "test_ec_point_add", "test_ec_point_mul", "test_generate", "test_marshal", "test_sign_verify", "test_sign_verify_raw"]
=>
["test_ECPrivateKey",
"test_ECPrivateKey_encrypted",
"test_PUBKEY",
"test_check_key",
"test_derive_key",
"test_dh_compute_key",
"test_dsa_sign_asn1_FIPS186_3",
"test_ec_group",
"test_ec_key",
"test_ec_point",
"test_ec_point_add",
"test_ec_point_mul",
"test_generate",
"test_marshal",
"test_sign_verify",
"test_sign_verify_raw"]
irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):003:0> p filter
/\A(?=.*)(?!.*(?-mix:(?-mix:memory_leak)|(?-mix:OpenSSL::TestEC.test_check_key)))/
=> /\A(?=.*)(?!.*(?-mix:(?-mix:memory_leak)|(?-mix:OpenSSL::TestEC.test_check_key)))/
irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):004:0> method = "test_check_key"
=> "test_check_key"
~~~
The intention here is to exclude the `test_check_key` test case.
Unfortunately this does not work as expected, because the negative filter
is never checked:
~~~
irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):005:0> filter === method
=> true
irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):006:0> filter === "#{suite}##{method}"
=> false
irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):007:0> filter === method || filter === "#{suite}##{method}"
=> true
~~~
Therefore always filter against the fully qualified method name
`#{suite}##{method}`, which should provide the expected result.
However, if plain string filter is used, keep checking also only the
method name.
This resolves [Bug #16936].
|
||
|---|---|---|
| .. | ||
| bundler | ||
| lib | ||
| m4 | ||
| releng | ||
| ruby_vm | ||
| test | ||
| asm_parse.rb | ||
| bisect.sh | ||
| build-transcode | ||
| checksum.rb | ||
| ci_functions.sh | ||
| colors | ||
| darwin-cc | ||
| disable_ipv6.sh | ||
| downloader.rb | ||
| enc-emoji-citrus-gen.rb | ||
| enc-emoji4unicode.rb | ||
| enc-unicode.rb | ||
| eval.rb | ||
| expand-config.rb | ||
| extlibs.rb | ||
| fake.rb | ||
| fetch-bundled_gems.rb | ||
| file2lastrev.rb | ||
| format-release | ||
| gem-unpack.rb | ||
| gen-mailmap.rb | ||
| gen_dummy_probes.rb | ||
| gen_ruby_tapset.rb | ||
| generic_erb.rb | ||
| git-refresh | ||
| gperf.sed | ||
| id2token.rb | ||
| ifchange | ||
| insns2vm.rb | ||
| install-sh | ||
| intern_ids.rb | ||
| leaked-globals | ||
| make-snapshot | ||
| make_hgraph.rb | ||
| mdoc2man.rb | ||
| merger.rb | ||
| mjit_archflag.sh | ||
| mjit_tabs.rb | ||
| mk_builtin_loader.rb | ||
| mkconfig.rb | ||
| mkrunnable.rb | ||
| node_name.rb | ||
| parse.rb | ||
| prereq.status | ||
| probes_to_wiki.rb | ||
| pure_parser.rb | ||
| rbinstall.rb | ||
| rbuninstall.rb | ||
| redmine-backporter.rb | ||
| release.sh | ||
| rmdirs | ||
| run-gcov.rb | ||
| run-lcov.rb | ||
| runruby.rb | ||
| search-cgvars.rb | ||
| strip-rdoc.rb | ||
| sync_default_gems.rb | ||
| test-bundled-gems.rb | ||
| test-coverage.rb | ||
| transcode-tblgen.rb | ||
| transform_mjit_header.rb | ||
| travis_retry.sh | ||
| travis_wait.sh | ||
| update-bundled_gems.rb | ||
| update-deps | ||
| vtlh.rb | ||
| ytab.sed | ||