diff --git a/lib/Test/Merges.pm b/lib/Test/Merges.pm index 23fe475..c4394e2 100644 --- a/lib/Test/Merges.pm +++ b/lib/Test/Merges.pm @@ -145,14 +145,24 @@ sub merge_ok { my $repo_name = "merge-$y-into-$x"; clone $x, $repo_name; chdir $repo_name; + + my @phases = qw( merge run output ); + my $check = sub { + my $phase = shift @phases; + pass("$phase ($y into $x)"); + }; try { perform_merge("../$y"); + $check->(); system("./run > obtained.txt"); + $check->(); system("diff -u expected.txt obtained.txt"); - pass("merge $y into $x"); + $check->(); + pass("$y into $x"); } catch { - fail("merge $y into $x"); + fail($_) for @phases; + fail("$y into $x"); }; chdir '..'; } diff --git a/t/adjacent-changes.t b/t/adjacent-changes.t index 297c370..6b07ac8 100644 --- a/t/adjacent-changes.t +++ b/t/adjacent-changes.t @@ -1,6 +1,6 @@ use strict; use warnings; -use Test::More tests => 2; +use Test::More tests => 8; use Test::Merges; # Perform two changes on immediately adjacent lines. diff --git a/t/dual-renames.t b/t/dual-renames.t index 7c3b215..0068307 100644 --- a/t/dual-renames.t +++ b/t/dual-renames.t @@ -1,6 +1,6 @@ use strict; use warnings; -use Test::More tests => 2; +use Test::More tests => 8; use Test::Merges; # One branch renames a function. The other branch renames that function's diff --git a/t/eol-comment.t b/t/eol-comment.t index d6667fb..ef23604 100644 --- a/t/eol-comment.t +++ b/t/eol-comment.t @@ -1,6 +1,6 @@ use strict; use warnings; -use Test::More tests => 2; +use Test::More tests => 8; use Test::Merges; # Add an end-of-line comment and change the same line diff --git a/t/indent-block-py.t b/t/indent-block-py.t index 91c526d..45ba4b8 100644 --- a/t/indent-block-py.t +++ b/t/indent-block-py.t @@ -1,6 +1,6 @@ use strict; use warnings; -use Test::More tests => 2; +use Test::More tests => 8; use Test::Merges; # indent-block in Python diff --git a/t/indent-block.t b/t/indent-block.t index 91ed7af..0b5c2f7 100644 --- a/t/indent-block.t +++ b/t/indent-block.t @@ -1,6 +1,6 @@ use strict; use warnings; -use Test::More tests => 2; +use Test::More tests => 8; use Test::Merges; # Modify and indent a block of code diff --git a/t/move-modify.t b/t/move-modify.t index 81171d3..3b6e799 100644 --- a/t/move-modify.t +++ b/t/move-modify.t @@ -1,6 +1,6 @@ use strict; use warnings; -use Test::More tests => 2; +use Test::More tests => 8; use Test::Merges; # One branch moves a file. Another branch modifies the file. diff --git a/t/nearby-changes.t b/t/nearby-changes.t index 39dce11..bc64b4a 100644 --- a/t/nearby-changes.t +++ b/t/nearby-changes.t @@ -1,6 +1,6 @@ use strict; use warnings; -use Test::More tests => 2; +use Test::More tests => 8; use Test::Merges; # Perform two changes on nearby lines diff --git a/t/same-change.t b/t/same-change.t index dcf84b7..2d70269 100644 --- a/t/same-change.t +++ b/t/same-change.t @@ -1,6 +1,6 @@ use strict; use warnings; -use Test::More tests => 2; +use Test::More tests => 8; use Test::Merges; # Perform the exact same change in two separate branches. diff --git a/t/trailing-whitespace.t b/t/trailing-whitespace.t index 9a1abcd..7a35624 100644 --- a/t/trailing-whitespace.t +++ b/t/trailing-whitespace.t @@ -1,6 +1,6 @@ use strict; use warnings; -use Test::More tests => 2; +use Test::More tests => 8; use Test::Merges; # Remove trailing whitespace on the same line as a meaningful change