Bugzilla – Attachment 174675 Details for
Bug 38299
Errors with updates caught in C4::Installer should be colored/highlighted
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38299: Update tests
Bug-38299-Update-tests.patch (text/plain), 2.29 KB, created by
Jonathan Druart
on 2024-11-18 10:31:59 UTC
(
hide
)
Description:
Bug 38299: Update tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-11-18 10:31:59 UTC
Size:
2.29 KB
patch
obsolete
>From 369531ece1bbc76b250373fe1121e4a8615b55dc Mon Sep 17 00:00:00 2001 >From: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> >Date: Thu, 7 Nov 2024 11:17:12 -0500 >Subject: [PATCH] Bug 38299: Update tests > >To test: >prove -v t/Koha/Installer/Output.t > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/Koha/Installer/Output.t | 40 ++++++++++++++++++++++++++++++++++++++- > 1 file changed, 39 insertions(+), 1 deletion(-) > >diff --git a/t/Koha/Installer/Output.t b/t/Koha/Installer/Output.t >index b78b2cd85e5..46dc91c6d40 100755 >--- a/t/Koha/Installer/Output.t >+++ b/t/Koha/Installer/Output.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 4; >+use Test::More tests => 8; > > use Koha::Installer::Output qw(say_warning say_failure say_success say_info); > >@@ -53,3 +53,41 @@ like( $lines[3], qr/\e\[\d+mTesting info message\e\[0m/, "Info message output > > # Remove the temporary file > unlink $temp_file; >+ >+# Next, test with no filehandler (letting say send to STDOUT by default) >+ >+# Redirect STDOUT to a variable - we don't actually want to print to the console for testing >+my $temp_out; >+open my $oldout, qw{>&}, "STDOUT"; >+close STDOUT; >+open STDOUT, '>:encoding(utf8)', \$temp_out; >+ >+say_warning( undef, "Testing warning message with no fh" ); >+say_failure( undef, "Testing failure message with no fh" ); >+say_success( undef, "Testing success message with no fh" ); >+say_info( undef, "Testing info message with no fh" ); >+ >+# Return STDOUT to previous state >+close STDOUT; >+open STDOUT, ">&", $oldout; >+ >+# Split the contents of $temp_out into an array for testing >+my @nofh_lines = split( "\n", $temp_out ); >+ >+# Test the output content >+like( >+ $nofh_lines[0], qr/\e\[\d+mTesting warning message with no fh\e\[0m/, >+ "Warning message with no fh output with ANSI color code" >+); >+like( >+ $nofh_lines[1], qr/\e\[\d+mTesting failure message with no fh\e\[0m/, >+ "Failure message with no fh output with ANSI color code" >+); >+like( >+ $nofh_lines[2], qr/\e\[\d+mTesting success message with no fh\e\[0m/, >+ "Success message with no fh output with ANSI color code" >+); >+like( >+ $nofh_lines[3], qr/\e\[\d+mTesting info message with no fh\e\[0m/, >+ "Info message with no fh output with ANSI color code" >+); >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38299
:
174250
|
174251
|
174252
|
174254
|
174255
|
174256
|
174259
|
174290
|
174291
|
174292
|
174293
|
174421
|
174423
|
174424
|
174455
|
174673
|
174674
| 174675 |
174676
|
174677