]> git.donarmstrong.com Git - debbugs.git/blobdiff - t/12_merge.t
Prefer the most recent debversion in the dependency list
[debbugs.git] / t / 12_merge.t
index e420ae3ac84af39f1dd2d77ba870a7fd3dffe80c..901b883465f14cd65f40f27349564894ed6dc893 100644 (file)
@@ -142,7 +142,7 @@ send_message(to => 'control@bugs.something',
                        ],
             body => <<'EOF') or fail 'message to control@bugs.something failed';
 debug 10
-clone 2 -1 -2 -3 -4 -5 -6
+clone 2 -1 -2 -3 -4 -5 -6 -7 -8
 retitle 2 foo
 owner 2 bar@baz.com
 submitter 2 fleb@bleh.com
@@ -159,19 +159,33 @@ fixed -4 1.2-3
 found -4 1.2-1
 found -5 1.2-5
 fixed -5 1.2-6
+block -7 by -1
+block -7 by -2
+block -8 by -2
+block -8 by -1
 thanks
 EOF
 
+# The order of "Blocked-By:" in *.summary is not deterministic, so
+# these tests assert that the blockers of bugs #9 and #10 are sorted
+# differently.
+ok(system('perl', '-i', '-pwe', 's/^Blocked-By: 4 3\n/Blocked-By: 3 4\n/;', $spool_dir . '/db-h/09/9.summary') == 0, 'Changed bug #9');
+ok(system('perl', '-i', '-pwe', 's/^Blocked-By: 3 4\n/Blocked-By: 4 3\n/;', $spool_dir . '/db-h/10/10.summary') == 0, 'Changed bug #10');
+ok(system('grep','-q','^Blocked-By: 3 4',"$spool_dir/db-h/09/9.summary") == 0,'Bug #9 has "Blocked-By: 3 4"');
+ok(system('grep','-q','^Blocked-By: 4 3',"$spool_dir/db-h/10/10.summary") == 0,'Bug #10 has "Blocked-By: 4 3"');
+
 test_control_commands(\%config,
                      forcemerge   => {command => 'forcemerge',
-                                      value   => '1 2',
+                                      value   => "2 3\nseverity 2 minor",
                                       status_key => 'mergedwith',
-                                      status_value => '2',
+                                      status_value => '3',
+                                      bug => 2,
                                      },
                      unmerge      => {command => 'unmerge',
-                                      value   => '1',
+                                      value   => '2',
                                       status_key => 'mergedwith',
                                       status_value => '',
+                                      bug => 2,
                                      },
                      forcemerge   => {command => 'forcemerge',
                                       value   => '1 2 5',
@@ -189,6 +203,12 @@ test_control_commands(\%config,
                                       status_value => '8',
                                       bug => '7',
                                      },
+                     merge        => {command => 'merge',
+                                      value   => '9 10',
+                                      status_key => 'mergedwith',
+                                      status_value => '10',
+                                      bug => '9',
+                                     },
                     );
 
 done_testing();