use Test::More 0.98; use_ok( 'Net::MAC::Vendor' ); # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Something that works { my $html = <<"HTML"; Search Results: IEEE Standards OUI Public Database

Here are the results of your search through the public section of the IEEE Standards OUI database report for 00-0D-07:


00-0D-07   (hex)             Calrec Audio Ltd
000D07     (base 16)            Calrec Audio Ltd
                                Nutclough Mill
                                Hebden Bridge West Yorkshire HX7 8EZ
                                UNITED KINGDOM


Your attention is called to the fact that the firms and numbers listed may not always be obvious in product implementation. Some manufacturers subcontract component manufacture and others include registered firms' OUIs in their products.


[IEEE Standards Home Page] -- [Search] -- [E-mail to Staff]
Copyright © 2004 IEEE
HTML my $expected_oui = <<"OUI"; 00-0D-07 (hex) Calrec Audio Ltd 000D07 (base 16) Calrec Audio Ltd Nutclough Mill Hebden Bridge West Yorkshire HX7 8EZ UNITED KINGDOM OUI { my $oui = Net::MAC::Vendor::extract_oui_from_html( $html, '00-0D-07' ); is( $oui, $expected_oui, "Extracted OUI" ); } } # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Entries after PRIVATE entries have extra data { my $html = <<"HTML"; Search Results: IEEE Standards OUI Public Database

Here are the results of your search through the public section of the IEEE Standards OUI database report for 000102:


00-01-01   (hex)		PRIVATE
000101     (base 16)		 
				 
00-01-02   (hex)		3COM CORPORATION
000102     (base 16)		3COM CORPORATION
				5400 Bayfront Plaza  - MS: 4220
				Santa Clara CA 95052
				UNITED STATES


Your attention is called to the fact that the firms and numbers listed may not always be obvious in product implementation. Some manufacturers subcontract component manufacture and others include registered firms' OUIs in their products.


[IEEE Standards Home Page] -- [Search] -- [E-mail to Staff]
Copyright © 2008 IEEE
HTML { my $expected_oui = <<"OUI"; 00-01-02 (hex) 3COM CORPORATION 000102 (base 16) 3COM CORPORATION 5400 Bayfront Plaza - MS: 4220 Santa Clara CA 95052 UNITED STATES OUI my $oui = Net::MAC::Vendor::extract_oui_from_html( $html, '00-01-02' ); is( $oui, $expected_oui, "Extracted OUI" ); } } # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Something that works { local *STDERR; open STDERR, ">", \my $output; my $oui = Net::MAC::Vendor::extract_oui_from_html( '' ); is( $oui, undef, "Get back undef for bad HTML" ); } done_testing();