add back the contents of this directory
[spider.git] / Geo / TAF / t / 1.t
1 # Before `make install' is performed this script should be runnable with
2 # `make test'. After `make install' it should work as `perl 1.t'
3
4 #########################
5
6 # change 'tests => 1' to 'tests => last_test_to_print';
7
8 use Test;
9 BEGIN { plan tests => 16 };
10
11 use Geo::TAF;
12 ok(1); # If we made it this far, we're ok.
13
14
15 #########################
16
17 # Insert your test code below, the Test::More module is use()ed here so read
18 # its man page ( perldoc Test::More ) for help writing this test script.
19
20
21 my $m;
22
23 ok ($m = new Geo::TAF);
24 ok (! $m->metar("EGSH 311420Z 29010KT 1600 SHSN SCT004 BKN006 01/M02 Q1021"));
25 ok (length $m->as_string > 30);
26 ok ($m->icao eq 'EGSH');
27 ok ($m->day == 31);
28 ok ($m->pressure == 1021);
29 ok ($m->temp == 1);
30 ok ($m->dewpoint == -2);
31 ok ($m->wind_dir == 290);
32 ok ($m->wind_speed == 10);
33 ok ($m->viz_dist == 1600);
34 ok ($m = new Geo::TAF);
35 ok (! $m->taf("EGSH 311205Z 311322 04010KT 9999 SCT020
36      TEMPO 1319 3000 SHSN BKN008 PROB30
37      TEMPO 1318 0700 +SHSN VV///
38      BECMG 1619 22005KT"));
39 ok ($m->chunks);
40 ok ($m->as_chunk_string);