App-MARC-Leader
view release on metacpan or search on metacpan
t/App-MARC-Leader/04-run.t view on Meta::CPAN
Length of the length-of-field portion: 4
Length of the starting-character-position portion: 5
Length of the implementation-defined portion: 0
Undefined: 0
END
stdout_is(
sub {
App::MARC::Leader->new->run;
return;
},
$right_ret,
'Process ex1.xml file (without description).',
);
# Test.
@ARGV = (
'-l',
'en',
'-d',
' nam a22 4500',
);
$right_ret = <<'END';
Record length: 0
Record status: n
Type of record: a
Bibliographic level: m
Type of control:
Character coding scheme: a
Indicator count: 2
Subfield code count: 2
Base address of data: 0
Encoding level:
Descriptive cataloging form:
Multipart resource record level:
Length of the length-of-field portion: 4
Length of the starting-character-position portion: 5
Length of the implementation-defined portion: 0
Undefined: 0
END
stdout_is(
sub {
App::MARC::Leader->new->run;
return;
},
$right_ret,
'Process leader from string (without description).',
);
sub help {
my $script = abs2rel(File::Object->new->file('04-run.t')->s);
# XXX Hack for missing abs2rel on Windows.
if ($OSNAME eq 'MSWin32') {
$script =~ s/\\/\//msg;
}
my $help = <<"END";
Usage: $script [-a] [-d] [-f marc_xml_file] [-h] [-l lang_code] [-v] [--version] [leader_string]
-a Print with ANSI colors (or use NO_COLOR/COLOR env variables).
-d Don't print description.
-f marc_xml_file MARC XML file.
-h Print help.
-l lang_code ISO 639-1 language code (default is from locales).
-v Verbose mode.
--version Print version.
[leader_string] MARC Leader string.
END
return $help;
}
( run in 2.704 seconds using v1.01-cache-2.11-cpan-140bd7fdf52 )