use Test2::V0; use Clone qw(clone); use Catmandu::Exporter::BibTeX; # don't touch this! Exporter adds newline at the end. my $bibtex = < 2602779, _type => 'inproceedings', author => [ "Boukricha, Hana", "Wachsmuth, Ipke", "Carminati, Maria Nella", "Knoeferle, Pia", "Müller-Leßmann, Stephan" ], language => 'English', publisher => 'IEEE', year => 2013, title => 'A Computational Model of Empathy: Empirical Evaluation', keywords => 'computer science' }; my $data2 = clone($data); my $bibtex_out; my $exporter = Catmandu::Exporter::BibTeX->new(file => \$bibtex_out); isa_ok($exporter, "Catmandu::Exporter::BibTeX"); can_ok($exporter, 'add'); can_ok($exporter, 'add_many'); $exporter->add($data); is($bibtex, $bibtex_out, "compare output"); is($data, $data2, "exporter is idempotent"); done_testing;