]> git.donarmstrong.com Git - debbugs.git/commitdiff
test that -1 actually refers to the current bug control.at.submit
authorDon Armstrong <don@donarmstrong.com>
Sat, 14 Jul 2012 19:52:46 +0000 (12:52 -0700)
committerDon Armstrong <don@donarmstrong.com>
Sat, 14 Jul 2012 19:52:46 +0000 (12:52 -0700)
Fix clearing of %clonebugs

scripts/process
t/14_control_at_submit.t

index 4236f6b4ccbdece729d1f8488c8cc0bf4afc204e..9a0eb65009cd334ceea3288019ad00dfa068a69a 100755 (executable)
@@ -990,7 +990,6 @@ if (@control_bits) {
        print {$transcript} fill_template('mail/excluded_from_control');
        print {$transcript} "Stopping processing here.\n\n";
     } else {
-       my %clonebugs = ();
        for my $control_bit (@control_bits) {
            $control_bit =~ s/\xef\xbb\xbf//g;
            next unless $control_bit =~ m/\S/;
index 7f0659f2cf00bd02c01833ce59e208d1b4db0975..38ea9d864181f78c2c3560be0a8b3b39824e9923 100644 (file)
@@ -1,7 +1,7 @@
 # -*- mode: cperl;-*-
 # $Id: 05_mail.t,v 1.1 2005/08/17 21:46:17 don Exp $
 
-use Test::More tests => 118;
+use Test::More tests => 120;
 
 use warnings;
 use strict;
@@ -124,6 +124,24 @@ my $status = read_bug(bug=>1);
 ok($status->{subject} eq 'new title','bug 1 retitled');
 ok($status->{severity} eq 'wishlist','bug 1 wishlisted');
 
+send_message(to => 'submit@bugs.something',
+            headers => [To   => 'submit@bugs.something',
+                        From => 'foo@bugs.something',
+                        Subject => 'Testing submit at control',
+                       ],
+            body => <<EOF) or fail 'message to submit@bugs.something failed';
+Package: foo
+Control: retitle -1 this is a new title
+EOF
+
+ok(system('sh','-c','find '.$sendmail_dir.q( -type f | xargs grep -q "Subject: Processed: Testing submit at control")) == 0,
+   'submit@bugs.something message was parsed without errors');
+
+$status = read_bug(bug=>2);
+ok($status->{subject} eq 'this is a new title','bug 2 retitled at submit@ time');
+
+
+
 # now we're going to go through and methododically test all of the control commands.
 my @control_commands =
      (
@@ -131,7 +149,7 @@ my @control_commands =
                       value   => '-2',
                       status_key => 'package',
                       status_value => 'foo',
-                      bug          => '3',
+                      bug          => '4',
                      },
        severity_wishlist => {command => 'severity',
                            value   => 'wishlist',
@@ -225,9 +243,9 @@ my @control_commands =
                       status_value => '',
                      },
        merge        => {command => 'merge',
-                      value   => '1 3',
+                      value   => '1 4',
                       status_key => 'mergedwith',
-                      status_value => '3',
+                      status_value => '4',
                      },
        unmerge      => {command => 'unmerge',
                       value   => '',
@@ -235,9 +253,9 @@ my @control_commands =
                       status_value => '',
                      },
        forcemerge   => {command => 'forcemerge',
-                      value   => '3',
+                      value   => '4',
                       status_key => 'mergedwith',
-                      status_value => '3',
+                      status_value => '4',
                      },
        unmerge      => {command => 'unmerge',
                       value   => '',