X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=Geo%2FTAF%2Ft%2F1.t;h=c54f63d5b962242e6abfb136e17f1bb79b8cd6f7;hb=42c0c882a3feb6dd2c70447066f980cc0f3d1b85;hp=ca5230cd87e924693dc95f6990151f151652aecb;hpb=3cc09786f798ed89076f05b538f726d397fdface;p=spider.git diff --git a/Geo/TAF/t/1.t b/Geo/TAF/t/1.t index ca5230cd..c54f63d5 100644 --- a/Geo/TAF/t/1.t +++ b/Geo/TAF/t/1.t @@ -6,12 +6,35 @@ # change 'tests => 1' to 'tests => last_test_to_print'; use Test; -BEGIN { plan tests => 1 }; +BEGIN { plan tests => 16 }; + use Geo::TAF; ok(1); # If we made it this far, we're ok. + ######################### # Insert your test code below, the Test::More module is use()ed here so read # its man page ( perldoc Test::More ) for help writing this test script. + +my $m; + +ok ($m = new Geo::TAF); +ok (! $m->metar("EGSH 311420Z 29010KT 1600 SHSN SCT004 BKN006 01/M02 Q1021")); +ok (length $m->as_string > 30); +ok ($m->icao eq 'EGSH'); +ok ($m->day == 31); +ok ($m->pressure == 1021); +ok ($m->temp == 1); +ok ($m->dewpoint == -2); +ok ($m->wind_dir == 290); +ok ($m->wind_speed == 10); +ok ($m->viz_dist == 1600); +ok ($m = new Geo::TAF); +ok (! $m->taf("EGSH 311205Z 311322 04010KT 9999 SCT020 + TEMPO 1319 3000 SHSN BKN008 PROB30 + TEMPO 1318 0700 +SHSN VV/// + BECMG 1619 22005KT")); +ok ($m->chunks); +ok ($m->as_chunk_string);