File: 13_output.t

package info (click to toggle)
libbibtex-parser-perl 1.03%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 260 kB
  • sloc: perl: 1,379; makefile: 2
file content (39 lines) | stat: -rw-r--r-- 735 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/perl -w

use Test::More;

use BibTeX::Parser;
use IO::File;


my $fh = new IO::File "t/bibs/01.bib", "r" ;

my $parser = new BibTeX::Parser $fh;




while (my $entry = $parser->next) {
    if($entry->key eq 'key01') {
	my $result1='@ARTICLE{key01,
    year = {1950},
    author = {Duck, Donald and Else, Someone},
    editor = {Itor, E. D. and Other, A. N.},
    title = {Title text},
    month = {January~1},
}';
	my $result2='@ARTICLE{key01,
    year = {1950},
    author = {Donald Duck and Someone Else},
    editor = {E. D. Itor and A. N. Other},
    title = {Title text},
    month = {January~1},
}';
    is($entry->to_string,$result1);
    is($entry->to_string(canonize_names=>0),$result2);
    }

}

done_testing();