| 1 | 1 | ▶ | use Test::More; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | |||||||||||
| 3 | # These tests make sure that if the id of e.g. an atom changes, the containing | ||||||||||
| 4 | # object is notified | ||||||||||
| 5 | |||||||||||
| 6 | #plan 'no_plan'; | ||||||||||
| 7 | 1 | plan tests => 5; | |||||||||
| 8 | |||||||||||
| 9 | 1 | ▶ | use Chemistry::File::Dumper; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 1 | my $mol = Chemistry::Mol->read("t/mol.pl"); | |||||||||
| 12 | 1 | isa_ok( $mol, 'Chemistry::Mol' ); | |||||||||
| 13 | 1 | is( $mol->atoms(1)->id, 'a1', 'id before' ); | |||||||||
| 14 | 1 | ok( $mol->atoms(1) == $mol->by_id('a1'), 'id matches before' ); | |||||||||
| 15 | |||||||||||
| 16 | 1 | $mol->atoms(1)->id('xyz123'); | |||||||||
| 17 | 1 | is( $mol->atoms(1)->id, 'xyz123', 'id after' ); | |||||||||
| 18 | 1 | ▶ | ok( $mol->atoms(1) == $mol->by_id('xyz123'), 'id matches after' ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | or diag sprintf "got %s, expected %s", $mol->atoms(1), $mol->by_id('xyz123'); | ||||||||||