• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

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

ItemTemplate
Summary UNIT TESTS FAIL - MARTIN CLEAVER PLEASE REVIEW
ReportedBy CrawfordCurrie
AppliesTo Engine
Priority Urgent
CurrentState Closed
WaitingFor

Checkins 7325
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r5 - 2005-11-05 - MartinCleaver
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback