1use Test::More;
2
3#plan 'no_plan';
4plan tests => 8;
5
6use Chemistry::File::Dumper;
7
8my $mol = Chemistry::Mol->read("t/mol.pl");
9isa_ok( $mol, 'Chemistry::Mol' );
10is( scalar $mol->atoms, 8,   'atoms before');
11is( scalar $mol->bonds, 7,   'bonds before');
12
13# delete bond
14$mol->bonds(6)->delete;
15is( scalar $mol->bonds, 6,   'delete bond');
16
17# delete atom by giving an atom object
18$mol->delete_atom($mol->atoms(1));
19is( scalar $mol->bonds, 6,   'delete atom obj - bonds');
20is( scalar $mol->atoms, 7,   'delete atom obj - atoms');
21
22# delete atom by giving an atom index
23$mol->delete_atom(1);
24is( scalar $mol->bonds, 3,   'delete atom index - bonds');
25is( scalar $mol->atoms, 6,   'delete atom index - atoms');
26
27