[Bug #984] Test::Unit::Assertions#assert_match double counts number of assertions


#1

Bug #984: Test::Unit::Assertions#assert_match double counts number of
assertions
http://redmine.ruby-lang.org/issues/show/984

e$B5/I<<Te(B: Naohisa G.
e$B%9%F!<%?%9e(B: Open, e$BM%@hEYe(B: Normal

Ruby 1.9.1-rc1 e$B$K$F!“e(BTest::Unit::Assertions#assert_match e$B$,e(B
assertionse$B$N?t$re(B1e$B2s$”$?$je(B2e$B$:$DA}$d$7$F$$$^$9!#e(B
e$B$J$*!"e(Bfailure e$B$N?t$O@5$7$/A}$($F$$$^$9!#e(B

e$B0J2<$NNc$G$O!"e(B2e$B2s$7$+e(Bassert_matche$B$r<B9T$7$J$$$O$:$J$N$Ke(B"4
assertions"e$B$K$J$C$F$$$^$9!#e(B

$ ruby191rc1 -v -r test/unit -e ‘class A<Test::Unit::TestCase; def
test_a; assert_match(/a/, “a”); end; def test_b; assert_match(/b/, “a”);
end; end’
ruby 1.9.1 (2008-12-30 patchlevel-0 revision 21203) [i686-linux]
Loaded suite -e
Started
.F
Finished in 0.001318 seconds.

  1. Failure:
    test_b(A) [-e:1]:
    Expected /b/ to match “a”.

2 tests, 4 assertions, 1 failures, 0 errors, 0 skips

1.8.7 e$B$G$O@5$7$/%+%&%s%H$7$F$$$^$9!#e(B

% ruby187p72 -v -r test/unit -e ‘class A<Test::Unit::TestCase; def
test_a; assert_match(/a/, “a”); end; def test_b; assert_match(/b/, “a”);
end; end’
ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-linux]
Loaded suite -e
Started
.F
Finished in 0.030196 seconds.

  1. Failure:
    test_b(A) [-e:1]:
    <“a”> expected to be =~
    </b/>.

2 tests, 2 assertions, 1 failures, 0 errors


#2

okkez e$B$G$9!#e(B

2009/1/5 Naohisa G. removed_email_address@domain.invalid:

Bug #984: Test::Unit::Assertions#assert_match double counts number of assertions
http://redmine.ruby-lang.org/issues/show/984

e$B5/I<<Te(B: Naohisa G.
e$B%9%F!<%?%9e(B: Open, e$BM%@hEYe(B: Normal

Ruby 1.9.1-rc1 e$B$K$F!“e(BTest::Unit::Assertions#assert_match e$B$,e(B
assertionse$B$N?t$re(B1e$B2s$”$?$je(B2e$B$:$DA}$d$7$F$$$^$9!#e(B
e$B$J$*!"e(Bfailure e$B$N?t$O@5$7$/A}$($F$$$^$9!#e(B

assert_match e$B0J30$G$be(B assert_respond_to
e$B$G%a%=%C%I$NB8:_%A%’%C%/$r$7$F$$$k$?$ae(B
assertions e$B$,Fs2sA}$($k$b$N$,$$$/$D$+$"$j$^$9!#e(B

  • assert_match
  • assert_empty
  • assert_includes
  • e$BBP1~$9$ke(B refute_*

e$B0l2s$Ne(B assert_* e$B8F$S=P$7$GFs2se(B assertions
e$B$,A}$($k$N$O$&$l$7$/$J$$$H;W$$$^$9!#e(B


#3

e$B%A%1%C%He(B #984 e$B$,99?7$5$l$^$7$?!#e(B (by Naohisa G.)

r21599e$B$Oe(Br21695e$B$Ge(Breverte$B$5$l$F$$$k$?$a!"e(B1.9.1-rc2e$B$G$O:FH/$7$F$$$^$9!#e(B
e$B$^$?!"8=;~E@$Ne(BRUBY_1_9_1e$B$*$h$Se(Btrunke$B$G$bF1MM$K:FH/$7$F$$$k$h$&$G$9!#e(B
Bug #984e$B$r:Fe(Bopene$B$9$k$3$H$r4uK>$7$^$9!#e(B

assertionse$B$N?t$,e(B2e$BA}$($k$N$,7y$J$N$O!"e(BRuby
1.8.xe$B$He(B1.9.1e$B$NN>J}$GF0$/e(B
e$B%W%m%0%i%`$r:n@.$9$k:]$K!“N>%P!<%8%g%s$G%F%9%H$rAv$i$;$?$H$-$Ne(B
assertionse$B$N?t$,0lCW$9$k$N$r3NG’$9$k$3$H$G!”%F%9%H<+BN$r4^$a$Fe(B
e$BJQ$J$3$H$,H/@8$;$:A[DjDL$jF0$$$F$$$k$+$I$&$+$r8+$?$$$+$i$G$9!#e(B


http://redmine.ruby-lang.org/issues/show/984


#4

e$B%A%1%C%He(B #984 e$B$,99?7$5$l$^$7$?!#e(B (by Nobuyoshi N.)

e$B%9%F!<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

Applied in changeset r21887.

http://redmine.ruby-lang.org/issues/show/984


#5

e$B%A%1%C%He(B #984 e$B$,99?7$5$l$^$7$?!#e(B (by Yuki S.)

e$B%9%F!<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B

applied in r21599.

http://redmine.ruby-lang.org/issues/show/984