Bugzilla – Attachment 192745 Details for
Bug 41216
Resurrect tt_valid.t
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41216: Remove confusion in test output
8e4c4da.patch (text/plain), 1.63 KB, created by
Jonathan Druart
on 2026-02-09 12:03:02 UTC
(
hide
)
Description:
Bug 41216: Remove confusion in test output
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2026-02-09 12:03:02 UTC
Size:
1.63 KB
patch
obsolete
>From 8e4c4dade0d658791c984d53e8cbf93bfa24e97f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 9 Feb 2026 12:56:09 +0100 >Subject: [PATCH] Bug 41216: Remove confusion in test output > >Clearly show the check's description in the test's failure >--- > xt/author/tt_valid.t | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > >diff --git a/xt/author/tt_valid.t b/xt/author/tt_valid.t >index 0375deedbfd..eafb30e29c7 100755 >--- a/xt/author/tt_valid.t >+++ b/xt/author/tt_valid.t >@@ -31,7 +31,7 @@ my @exclusions = qw( > ); > @tt_files = array_minus @tt_files, @exclusions; > >-plan tests => scalar(@tt_files) + 1; >+plan tests => scalar(@tt_files) * 2 + 1; > > my @translatable_attributes = qw(alt content title value label placeholder aria-label); > >@@ -80,17 +80,20 @@ my $checkers = [ > for my $filepath (@tt_files) { > my $parser = C4::TTParser->new; > $parser->build_tokens($filepath); >- my @errors; >+ my $errors = {}; > while ( my $token = $parser->next_token ) { > my $attr = $token->{_attr}; > next unless $attr; > > for my $checker (@$checkers) { > my @e = $checker->{check}->( $checker, $filepath, $token ); >- push @errors, @e if @e; >+ push @{ $errors->{ $checker->{description} } }, @e if @e; > } > } >- is( scalar(@errors), 0 ) or diag( "$filepath: " . join( ', ', @errors ) ); >+ for my $checker (@$checkers) { >+ my @errors = @{ $errors->{ $checker->{description} } || [] }; >+ is( scalar(@errors), 0, $checker->{description} ) or diag( "$filepath: " . join( ', ', @errors ) ); >+ } > } > > =head1 NAME >-- >2.43.0 >
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 41216
:
189316
|
189317
|
189318
|
189328
|
189329
|
189330
|
190046
|
190047
|
192744
|
192745
|
192746
|
192955
|
192956
|
192957
|
192958
|
192959
|
192960
|
192961
|
192962