From 746d69019f58d1f6159a5b5fe5427bdff1758af4 Mon Sep 17 00:00:00 2001 From: brian d foy Date: Wed, 21 Jun 2023 21:51:23 -0400 Subject: [PATCH] output some error info if system fails --- t/cp/gh-115-copy-into-dir.t | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/t/cp/gh-115-copy-into-dir.t b/t/cp/gh-115-copy-into-dir.t index bff64d8d..b3348c07 100644 --- a/t/cp/gh-115-copy-into-dir.t +++ b/t/cp/gh-115-copy-into-dir.t @@ -47,7 +47,9 @@ On Windows, cp a.txt b.txt fails at line 252 with message "cp: can not access B. subtest 'same directory' => sub { my $rc = system $^X, $program_path, $filename, $second_filename; - is $rc, 0, 'system exited with 0'; + is $rc, 0, 'system exited with 0' or diag( + "system failed:\n\t$!\n\t$^E" + ); ok -e $second_filename, "$second_filename exists"; }; @@ -59,7 +61,9 @@ Overall, this script has problems with case sensitivity, for example cp a.txt di subtest 'into directory' => sub { my $rc = system $^X, $program_path, $filename, $subdir; - is $rc, 0, 'system exited with 0'; + is $rc, 0, 'system exited with 0' or diag( + "system failed:\n\t$!\n\t$^E" + ); ok -e catfile( $subdir, $filename ), "$subdir/$second_filename exists"; };