Recent changes to the registration code have broken the unit tests.
Please run your unit tests when you change your code.
I am going to build beta 4 with the failing tests, but the release cannot be built until these are fixed.
--
CC
Will look tomorrow.
--
MC
Martin prodded me to have a look at this.... It appears that the fix for my bug report
Item540 introduced in rev. 6770 broke the unit tests in
RegisterTests.pm
. Martin sent me some hints in IRC, I've put together a fix (attached).
After applying this patch,
perl bin/TestRunner.pl unit/RegisterTests.pm
reports
OK (11 tests)
.
--
TWiki:Main.HaraldJoerg
- 05 Nov 2005
What the F*** - I can't attach:
TWiki detected an error or attempted hack - please check your TWiki logs and webserver logs for more information.
Use of uninitialized value in substitution iterator
FWIW, I've uploaded it to
http://pweb.uunet.de/oook.m/twiki/RegisterTests.diff.item842
, and putting it here, just in case:
Index: unit/RegisterTests.pm
===================================================================
--- unit/RegisterTests.pm (Revision 7324)
+++ unit/RegisterTests.pm (Arbeitskopie)
@@ -143,6 +143,22 @@
my $e = shift;
$this->assert_str_equals("attention", $e->{template});
$this->assert_str_equals("thanks", $e->{def});
+ $this->assert_equals(2, scalar(@mails));
+ my $done = '';
+ foreach my $mail ( @mails ) {
+ if( $mail =~ /^Subject:.*Registration for/m ) {
+ if( $mail =~ /^To: .*\b$testUserEmail\b/m ) {
+ $this->assert(!$done, $done."\n---------\n".$mail);
+ $done = $mail;
+ } else {
+ $this->assert_matches(qr/To: %WIKIWEBMASTER/, $mail );
+ }
+ } else {
+ $this->assert(0, $mail);
+ }
+ }
+ $this->assert($done);
+ @mails = ();
} catch TWiki::AccessControlException with {
my $e = shift;
$this->assert(0, $e->stringify);
@@ -250,25 +266,17 @@
} catch Error::Simple with {
$this->assert(0, shift->stringify());
};
- $this->assert_equals(3, scalar(@mails));
- my @done = ('', '' );
+ $this->assert_equals(1, scalar(@mails));
+ my $done = '';
foreach my $mail ( @mails ) {
- if( $mail =~ /^Subject:.*Registration for/m ) {
- if( $mail =~ /^To: .*\b$testUserEmail\b/m ) {
- $this->assert(!$done[0], $done[0]."\n---------\n".$mail);
- $done[0] = $mail;
- } else {
- $this->assert_matches(qr/To: %WIKIWEBMASTER/, $mail );
- }
- } elsif( $mail =~ /Your verification code is /m ) {
- $this->assert(!$done[1], $done[1]."\n---------\n".$mail);
- $done[1] = $mail;
+ if( $mail =~ /Your verification code is /m ) {
+ $this->assert(!$done, $done."\n---------\n".$mail);
+ $done = $mail;
} else {
$this->assert(0, $mail);
}
}
- $this->assert($done[0]);
- $this->assert($done[1]);
+ $this->assert($done);
@mails = ();
}
--
TWiki:Main.HaraldJoerg
- 05 Nov 2005
Thanks Harald, much appreciated.
svn commit -m "Item842: Harald's test to fix up the unit tests following Item540 (SVN6770)" unit/RegisterTests.pm
Sending unit/RegisterTests.pm
Transmitting file data .
Committed revision 7325.
--
MC