Lines 1-7
Link Here
|
1 |
#!/usr/bin/perl; |
1 |
#!/usr/bin/perl; |
2 |
|
2 |
|
3 |
use Modern::Perl; |
3 |
use Modern::Perl; |
4 |
use Test::More tests => 11; |
4 |
use Test::More tests => 12; |
5 |
use Test::MockModule; |
5 |
use Test::MockModule; |
6 |
use MARC::Record; |
6 |
use MARC::Record; |
7 |
use MARC::Field; |
7 |
use MARC::Field; |
Lines 29-35
my $csv_content = q(Title=245$a|Author=245$c|Subject=650$a);
Link Here
|
29 |
my $csv_profile_id_1 = insert_csv_profile({ csv_content => $csv_content }); |
29 |
my $csv_profile_id_1 = insert_csv_profile({ csv_content => $csv_content }); |
30 |
my $csv = Text::CSV::Encoded->new(); |
30 |
my $csv = Text::CSV::Encoded->new(); |
31 |
|
31 |
|
32 |
my $csv_output = C4::Record::marcrecord2csv( $biblionumber, $csv_profile_id_1, 1, $csv ); |
32 |
# Test bad biblionumber case |
|
|
33 |
my $csv_output = C4::Record::marcrecord2csv( -1, $csv_profile_id_1, 1, $csv ); |
34 |
ok (! defined $csv_output, 'Bad biblionumber gives undef as expected.'); |
35 |
|
36 |
$csv_output = C4::Record::marcrecord2csv( $biblionumber, $csv_profile_id_1, 1, $csv ); |
33 |
|
37 |
|
34 |
is( $csv_output, q[Title|Author|Subject |
38 |
is( $csv_output, q[Title|Author|Subject |
35 |
"The art of computer programming,The art of another title"|"Donald E. Knuth.,Donald E. Knuth. II"|"Computer programming.,Computer algorithms." |
39 |
"The art of computer programming,The art of another title"|"Donald E. Knuth.,Donald E. Knuth. II"|"Computer programming.,Computer algorithms." |
36 |
- |
|
|