"Fossies" - the Fresh Open Source Software Archive

Member "email-reminder-0.8.1/t/subjects.t" (14 Mar 2015, 745 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. See also the last Fossies "Diffs" side-by-side code changes report for "subjects.t": 0.7.7_vs_0.7.8.

    1 #!/usr/bin/perl
    2 
    3 use strict;
    4 use warnings;
    5 
    6 use Test::More tests => 12;
    7 use EmailReminder::EventList;
    8 
    9 my @strs = (
   10     '5-a-side',
   11     '5-a-side',
   12     'Christmas Day',
   13     'New Year\'s Day',
   14     '14th anniversary of My Sister and Bro in Law',
   15     '18th anniversary of My Brother and Sis in Law',
   16     'PayDay',
   17     'Clean the House',
   18     'Sister\'s birthday',
   19     'Bro\'s birthday',
   20     'Friend\'s birthday',
   21 );
   22 
   23 # tests
   24 my $events = EmailReminder::EventList->new('t/data.xml', 1);
   25 
   26 # loop through all the events themselves
   27 foreach my $event ($events->get_events()) {
   28     my ($i) = grep { $strs[$_] eq $event->get_subject } 0..$#strs;
   29     splice (@strs, $i, 1);
   30     ok(defined($i), "event $i");
   31 }
   32 is(scalar @strs, 0, "all subjects were found");