Bugzilla – Attachment 100389 Details for
Bug 24583
Rewrite mandatory installation files to YAML
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24583: adjust xt/sample_notices.t
Bug-24583-adjust-xtsamplenoticest.patch (text/plain), 2.14 KB, created by
Jonathan Druart
on 2020-03-09 15:15:18 UTC
(
hide
)
Description:
Bug 24583: adjust xt/sample_notices.t
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-03-09 15:15:18 UTC
Size:
2.14 KB
patch
obsolete
>From 9c801f33d222754c8db785898580805117dd0e76 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 9 Mar 2020 16:14:58 +0100 >Subject: [PATCH] Bug 24583: adjust xt/sample_notices.t > >--- > xt/sample_notices.t | 18 ++++++++++++++---- > 1 file changed, 14 insertions(+), 4 deletions(-) > >diff --git a/xt/sample_notices.t b/xt/sample_notices.t >index 26534077ea..de4004a602 100755 >--- a/xt/sample_notices.t >+++ b/xt/sample_notices.t >@@ -22,7 +22,7 @@ use Test::More qw(no_plan); > > > my $root_dir = 'installer/data/mysql'; >-my $base_notices_file = "en/mandatory/sample_notices.sql"; >+my $base_notices_file = "en/mandatory/sample_notices.yml"; > my @trans_notices_files = qw( > fr-FR/1-Obligatoire/sample_notices.sql > fr-CA/obligatoire/sample_notices.sql >@@ -38,7 +38,7 @@ my @trans_notices_files = qw( > ok( > open( my $ref_fh, "<", "$root_dir/$base_notices_file" ), > "Open reference sample notices file $root_dir/$base_notices_file" ); >-my $ref_notice = get_notices_from_file( $ref_fh ); >+my $ref_notice = get_notices_from_yml_file( $ref_fh ); > my @ref_notices = sort { lc $a cmp lc $b } keys %$ref_notice; > cmp_ok( > $#ref_notices, '>=', 0, >@@ -53,7 +53,7 @@ foreach my $file_name ( @trans_notices_files ) { > # Get sample notices from SQL file populating letters table with INSERT > # statement. > # >-sub get_notices_from_file { >+sub get_notices_from_sql_file { > my $fh = shift; > my %notice; > while ( <$fh> ) { >@@ -62,6 +62,16 @@ sub get_notices_from_file { > } > return \%notice; > } >+sub get_notices_from_yml_file { >+ my $fh = shift; >+ my %notice; >+ while ( <$fh> ) { >+ next unless /^\s+code:\s([\_A-Z_]*)$/; >+ $notice{$1} = 1; >+ } >+ return \%notice; >+} >+ > > > sub compare_notices { >@@ -69,7 +79,7 @@ sub compare_notices { > ok( > open( my $trans_fh,"<", "$root_dir/$trans_file" ), > "Open translated sample notices file $root_dir/$trans_file" ); >- my $trans_notice = get_notices_from_file( $trans_fh ); >+ my $trans_notice = get_notices_from_sql_file( $trans_fh ); > use YAML; > my @trans_notices = sort { lc $a cmp lc $b } keys %$trans_notice; > cmp_ok( >-- >2.20.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 24583
:
98414
|
98415
|
98416
|
98417
|
98418
|
99397
|
99398
|
99399
|
99400
|
99401
|
100195
|
100346
|
100347
|
100348
|
100349
|
100350
|
100351
|
100389
|
100391