Skip to content

Instantly share code, notes, and snippets.

@paveljurca
Last active October 11, 2015 16:19
Show Gist options
  • Save paveljurca/57deec705e09ac4070fc to your computer and use it in GitHub Desktop.
Save paveljurca/57deec705e09ac4070fc to your computer and use it in GitHub Desktop.
use Test::More tests => 1;
use strict;
use warnings;
use Data::Types qw/:float/;
# module loaded
use_ok('Airport::Data');
# fixture
my $airports_ref = Airport::Data::parse_airports('t/data/airports1.csv');
=head2 @Test
data validity
=cut
for my $air (@{ $airports_ref }) {
# expected values are non empty
ok(exists $air->{$_} and $air->{$_} =~ /\S+/)
for (qw/id name latitude_deg longitude_deg iata_code/);
# latitude and longitude are floats
ok(is_float($air->{$_}), 'floating point')
for (qw/latitude_deg longitude_deg/);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment