File: 01-comparisonstring.t

package info (click to toggle)
libmarc-spec-perl 2.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 244 kB
  • sloc: perl: 686; makefile: 2
file content (17 lines) | stat: -rwxr-xr-x 571 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use strict;
use Test::More;
use Test::Exception;
use MARC::Spec::Comparisonstring;
use MARC::Spec::Parser;

my $cmp = MARC::Spec::Comparisonstring->new('this\sis\sa\stest');
ok $cmp->raw eq 'this\sis\sa\stest', 'raw';
ok $cmp->comparable eq 'this is a test', 'comparable';

throws_ok {MARC::Spec::Comparisonstring->new('this|is|wrong');} qr/^MARCspec Comparisonstring exception.*/, 'MARCspec Comparisonstring exception';


my $parser = MARC::Spec::parse('245$a{245$a~\/}');
ok $parser->subfields->[0]->subspecs->[0]->right->raw eq '/', 'subspec right raw';

done_testing;