1use Test::More tests => 6; 2 3BEGIN { use_ok('Chemistry::File::Dumper') }; 4 5my $mol = Chemistry::Mol->read("t/mol.pl", format => 'dumper'); 6isa_ok($mol, "Chemistry::Mol", 'read'); 7 8my $mol_auto = Chemistry::Mol->read("t/mol.pl"); 9isa_ok($mol, "Chemistry::Mol", 'read (autodetect)'); 10 11my $s = $mol->print(format=>'dumper'); 12my $s2 = $mol_auto->print(format=>'dumper'); 13is($s, $s2, 'dump and compare'); 14 15$mol->write('t/test1.pl'); 16my $mol3 = Chemistry::Mol->read("t/test1.pl"); 17my $s3 = $mol->print(format=>'dumper'); 18 19is($s, $s3, 'write and read and compare'); 20is_deeply($mol, $mol3, 'deep compare'); 21unlink 't/test1.pl'; 22 23