Bugzilla – Attachment 34406 Details for
Bug 12404
CSV profiles improvements (concatenations, substrings, conditions...)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12404: Add new unit tests
Bug-12404-Add-new-unit-tests.patch (text/plain), 2.89 KB, created by
Jonathan Druart
on 2014-12-15 10:53:04 UTC
(
hide
)
Description:
Bug 12404: Add new unit tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-12-15 10:53:04 UTC
Size:
2.89 KB
patch
obsolete
>From 040a40c068aa2d0f6f95bd959c846a37bbe9847b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 11 Feb 2014 13:25:29 +0100 >Subject: [PATCH] Bug 12404: Add new unit tests > >These unit tests reflect the changes done in next patches. > >Signed-off-by: Courret <scourret@gmail.com> >--- > t/db_dependent/Record/marcrecord2csv.t | 34 +++++++++++++++++++++++++++++++++- > 1 file changed, 33 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Record/marcrecord2csv.t b/t/db_dependent/Record/marcrecord2csv.t >index 20ee8e6..aa4baec 100644 >--- a/t/db_dependent/Record/marcrecord2csv.t >+++ b/t/db_dependent/Record/marcrecord2csv.t >@@ -1,7 +1,7 @@ > #!/usr/bin/perl; > > use Modern::Perl; >-use Test::More tests => 4; >+use Test::More tests => 8; > use Test::MockModule; > use MARC::Record; > use MARC::Field; >@@ -47,6 +47,38 @@ $csv_output = C4::Record::marcrecord2csv( $biblionumber, $csv_profile_id_2, 0, $ > is( $csv_output, q["The art of computer programming,Donald E. Knuth.,0;The art of another title,Donald E. Knuth. II,1"|"Computer programming.,462;Computer algorithms.,499" > ], q|normal way: headers are not display if not needed| ); > >+$csv_content = q(Title and author=[% FOREACH field IN fields.245 %][% field.a.0 %] [% field.c.0 %][% END %]|Subject=650$a); >+my $csv_profile_id_3 = insert_csv_profile({ csv_content => $csv_content }); >+ >+$csv_output = C4::Record::marcrecord2csv( $biblionumber, $csv_profile_id_3, 1, $csv ); >+is( $csv_output, q["Title and author"|Subject >+"The art of computer programming Donald E. Knuth.The art of another title Donald E. Knuth. II"|"Computer programming.,Computer algorithms." >+], q|TT way: display all 245$a and 245$c| ); >+ >+$csv_content = q(Subject=[% FOREACH field IN fields.650 %][% IF field.indicator.2 %][% field.a.0 %][% END %][% END %]); >+my $csv_profile_id_4 = insert_csv_profile({ csv_content => $csv_content }); >+ >+$csv_output = C4::Record::marcrecord2csv( $biblionumber, $csv_profile_id_4, 1, $csv ); >+is( $csv_output, q[Subject >+"Computer programming." >+], q|TT way: display 650$a if indicator 2 for 650 is set| ); >+ >+$csv_content = q|Language=[% fields.008.0.substr( 28, 3 ) %]|; >+my $csv_profile_id_5 = insert_csv_profile({ csv_content => $csv_content }); >+ >+$csv_output = C4::Record::marcrecord2csv( $biblionumber, $csv_profile_id_5, 1, $csv ); >+is( $csv_output, q[Language >+eng >+], q|TT way: export language from the control field 008| ); >+ >+$csv_content = q|Title=[% IF fields.100.0.indicator.1 %][% fields.245.0.a.0 %][% END %]|; >+my $csv_profile_id_6 = insert_csv_profile({ csv_content => $csv_content }); >+ >+$csv_output = C4::Record::marcrecord2csv( $biblionumber, $csv_profile_id_6, 1, $csv ); >+is( $csv_output, q[Title >+"The art of computer programming" >+], q|TT way: display first subfield a for first field 245 if indicator 1 for field 100 is set| ); >+ > sub insert_csv_profile { > my ( $params ) = @_; > my $csv_content = $params->{csv_content}; >-- >2.1.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 12404
:
28767
|
28768
|
28769
|
28770
|
28771
|
33170
|
33171
|
33172
|
33173
|
33174
|
33263
|
33477
|
34288
|
34289
|
34290
|
34291
|
34292
|
34293
|
34294
|
34300
|
34301
|
34302
|
34303
|
34405
|
34406
|
34407
|
34408
|
34409
|
34410
|
34411
|
35048
|
35049
|
35050
|
35051
|
35052
|
35053
|
35054