1 # -*-Perl-*- Test Harness script for Bioperl
10 test_begin(-tests => 27);
12 use_ok('Bio::Tools::ECnumber');
17 my $EC1 = Bio::Tools::ECnumber->new( -ec_string => " EC 01. 02.03.00022 ",
18 -comment => "is 1.2.3.22" );
21 my $EC2 = Bio::Tools::ECnumber->new( -ec_string => "ec:1.2.3.-",
22 -comment => "is 1.2.3.-" );
25 my $EC3 = $EC1->copy();
27 isa_ok( $EC1,"Bio::Tools::ECnumber" );
29 isa_ok( $EC3,"Bio::Tools::ECnumber");
31 is( $EC1->EC_string(), "1.2.3.22" );
33 is( $EC1->EC_string(), "1.2.3.22" );
35 is( $EC1->to_string(), "1.2.3.22" );
37 is( $EC1->comment(), "is 1.2.3.22" );
39 is( $EC1->enzyme_class(), "1" );
41 is( $EC1->sub_class(), "2" );
43 is( $EC1->sub_sub_class(), "3" );
45 is( $EC1->serial_number(), "22" );
47 ok( $EC3->is_equal( $EC1 ) );
49 ok( $EC3->is_equal( "1.2.3.22" ) );
51 ok( ! $EC3->is_equal( "1.2.3.-" ) );
53 ok( ! $EC3->is_equal( "1.2.3.23" ) );
55 ok( $EC1->is_member( $EC2 ) );
57 ok( $EC1->is_member( "1.2.3.-" ) );
61 ok( $EC2->is_member( $EC1 ) );
63 is( $EC1->to_string(), "-.-.-.-" );
65 $EC1->enzyme_class( 44 );
67 $EC1->sub_class( "033" );
69 $EC1->sub_sub_class( 22 );
71 $EC1->serial_number( "-" );
73 is( $EC1->to_string(), "44.33.22.-" );
75 ok( ! $EC1->is_member( "44.33.23.-" ) );
77 ok( ! $EC1->is_member( "44.33.22.1" ) );
79 ok( $EC1->is_member( "-.-.-.-" ) );
81 ok( $EC1->is_member( "44.-.-.-" ) );
83 ok( $EC1->is_member( "44.33.-.-" ) );
85 ok( $EC1->is_member( "EC 44.33.22.-" ) );
87 ok( ! $EC1->is_member( "45.33.22.-" ) );