Bugzilla – Attachment 183262 Details for
Bug 40128
StripWhitespaceChars can create empty subfields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40128: Unit tests
Bug-40128-Unit-tests.patch (text/plain), 1.61 KB, created by
Roman Dolny
on 2025-06-15 12:19:28 UTC
(
hide
)
Description:
Bug 40128: Unit tests
Filename:
MIME Type:
Creator:
Roman Dolny
Created:
2025-06-15 12:19:28 UTC
Size:
1.61 KB
patch
obsolete
>From a206778130d6b60d3027cf138b6cc03d9ac03c5c Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Sat, 14 Jun 2025 22:06:55 +0000 >Subject: [PATCH] Bug 40128: Unit tests > >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >--- > t/RecordProcessor.t | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > >diff --git a/t/RecordProcessor.t b/t/RecordProcessor.t >index c5a967788e..5c22d6fe6d 100755 >--- a/t/RecordProcessor.t >+++ b/t/RecordProcessor.t >@@ -215,7 +215,7 @@ subtest 'options() tests' => sub { > > subtest "'TrimFields' filter tests" => sub { > >- plan tests => 2; >+ plan tests => 4; > > # Test default values with a MARC::Record record > my $record = MARC::Record->new(); >@@ -225,6 +225,8 @@ subtest "'TrimFields' filter tests" => sub { > [ '150', ' ', ' ', a => 'Test' ], > [ '520', ' ', ' ', a => "This is\na test!\t" ], > [ '521', ' ', ' ', a => "This is a\t test!\t" ], >+ [ '522', ' ', ' ', a => "This is a test!", b => " " ], >+ [ '523', ' ', ' ', a => " " ], > ); > > my $p = Koha::RecordProcessor->new( { filters => ['TrimFields'] } ); >@@ -235,4 +237,10 @@ subtest "'TrimFields' filter tests" => sub { > > my $get521a = $record->subfield( '521', 'a' ); > is( $get521a, "This is a\t test!", "Trailing tabs are stripped while inner tabs are kept" ); >+ >+ my $get522b = $record->subfield( '522', 'b' ); >+ isnt( $get522b, "", "Subfield containing spaces only removed from the field" ); >+ >+ my $get523 = $record->field('523'); >+ is( $get523, undef, "Field with only a subfield containing spaces removed from the record" ); > }; >-- >2.39.5
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 40128
:
183259
|
183260
|
183261
| 183262