Chemistry-Mol-0.35/t/delete.t

filter: Statementstmt 100% 22 / 22 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 100% 25 / 25 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Chemistry-Mol-0.35/t/add_implicit_h.t ↑ Summary Chemistry-Mol-0.35/t/graph.t »
1 1 ▶use Test::More;
Subroutine BEGIN: called CC=1 SCAR=0.0
2  
3 #plan 'no_plan';
4 1 plan tests => 8;
5  
6 1 ▶use Chemistry::File::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 my $mol = Chemistry::Mol->read("t/mol.pl");
9 1 isa_ok( $mol, 'Chemistry::Mol' );
10 1 is( scalar $mol->atoms, 8, 'atoms before');
11 1 is( scalar $mol->bonds, 7, 'bonds before');
12  
13 # delete bond
14 1 $mol->bonds(6)->delete;
15 1 is( scalar $mol->bonds, 6, 'delete bond');
16  
17 # delete atom by giving an atom object
18 1 $mol->delete_atom($mol->atoms(1));
19 1 is( scalar $mol->bonds, 6, 'delete atom obj - bonds');
20 1 is( scalar $mol->atoms, 7, 'delete atom obj - atoms');
21  
22 # delete atom by giving an atom index
23 1 $mol->delete_atom(1);
24 1 is( scalar $mol->bonds, 3, 'delete atom index - bonds');
25 1 is( scalar $mol->atoms, 6, 'delete atom index - atoms');
26  
« Chemistry-Mol-0.35/t/add_implicit_h.t ↑ Summary Chemistry-Mol-0.35/t/graph.t »