Date-Holidays-NYSE

 view release on metacpan or  search on metacpan

t/200_year_2018.t  view on Meta::CPAN

# - perl -
use strict;
use warnings;
use Data::Dumper qw{Dumper};
use Test::More tests => 11;
use Date::Holidays::NYSE qw{is_holiday holidays};

#From: https://web.archive.org/web/20170702003212/https://www.nyse.com/markets/hours-calendars

my $year = 2018;
is( is_holiday($year,  1,  1), q{New Year's Day});
is( is_holiday($year,  1, 15), q{Martin Luther King, Jr. Day});
is( is_holiday($year,  2, 19), q{Washington's Birthday});
is( is_holiday($year,  3, 30), q{Good Friday});
is( is_holiday($year,  5, 28), q{Memorial Day});
ok(!is_holiday($year,  6, 19), q{Juneteenth National Independence Day});
is( is_holiday($year,  7,  4), q{Independence Day});
is( is_holiday($year,  9,  3), q{Labor Day});
is( is_holiday($year, 11, 22), q{Thanksgiving Day});
is( is_holiday($year, 12, 25), q{Christmas Day});

is(scalar(keys %{holidays($year)}), 9);



( run in 6.496 seconds using v1.01-cache-2.11-cpan-b301d465b3d )