"Fossies" - the Fresh Open Source Software Archive

Member "email-reminder-0.8.1/t/utils.t" (14 Mar 2015, 809 Bytes) of package /linux/privat/email-reminder-0.8.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/usr/bin/perl
    2 
    3 use strict;
    4 use warnings;
    5 
    6 use Test::More tests => 15;
    7 use EmailReminder::Utils;
    8 
    9 # just do a selection
   10 my %year = (
   11     1 => { th => 'st', special => '(Paper) ' },
   12     2 => { th => 'nd', special => '(Cotton) ' },
   13     3 => { th => 'rd', special => '(Leather) ' },
   14     4 => { th => 'th', special => '(Linen) ' },
   15     5 => { th => 'th', special => '(Wood) ' },
   16     10 => { th => 'th', special => '(Tin) ' },
   17     60 => { th => 'th', special => '(Diamond) ' },
   18 );
   19 
   20 # just do a selection of dates
   21 foreach my $year ( sort { $a <=> $b } keys %year ) {
   22     is(EmailReminder::Utils::get_th($year), $year{$year}->{th}, "$year index");
   23     is(EmailReminder::Utils::get_special_name($year), $year{$year}->{special}, "$year special");
   24 }
   25 
   26 is(EmailReminder::Utils::get_special_name(22), undef, "22 index");