exercism-perl5

Repository for my Perl 5 Exercism exercises
git clone git://git.samirparikh.com/exercism-perl5
Log | Files | Refs | README

meetup.t (25453B) - raw


      1 #!/usr/bin/env perl
      2 use Test2::V0;
      3 use JSON::PP;
      4 use constant JSON => JSON::PP->new;
      5 
      6 use FindBin qw<$Bin>;
      7 use lib $Bin, "$Bin/local/lib/perl5";
      8 
      9 use Meetup qw<meetup>;
     10 
     11 my @test_cases = do { local $/; @{ JSON->decode(<DATA>) }; };
     12 plan 96;
     13 
     14 imported_ok qw<meetup> or bail_out;
     15 
     16 use constant MONTHS => qw<
     17   January February March     April   May      June
     18   July    August   September October November December
     19 >;
     20 
     21 for my $case (@test_cases) {
     22   my $input_string = sprintf( '%s %s of %s %u',
     23     ucfirst( $case->{input}{week} ),
     24     $case->{input}{dayofweek},
     25     (MONTHS)[ $case->{input}{month} - 1 ],
     26     $case->{input}{year} );
     27 
     28   is meetup($input_string), $case->{expected}, $case->{description};
     29 }
     30 
     31 __DATA__
     32 [
     33   {
     34     "description": "when teenth Monday is the 13th, the first day of the teenth week",
     35     "expected": "2013-05-13",
     36     "input": {
     37       "dayofweek": "Monday",
     38       "month": 5,
     39       "week": "teenth",
     40       "year": 2013
     41     },
     42     "property": "meetup"
     43   },
     44   {
     45     "description": "when teenth Monday is the 19th, the last day of the teenth week",
     46     "expected": "2013-08-19",
     47     "input": {
     48       "dayofweek": "Monday",
     49       "month": 8,
     50       "week": "teenth",
     51       "year": 2013
     52     },
     53     "property": "meetup"
     54   },
     55   {
     56     "description": "when teenth Monday is some day in the middle of the teenth week",
     57     "expected": "2013-09-16",
     58     "input": {
     59       "dayofweek": "Monday",
     60       "month": 9,
     61       "week": "teenth",
     62       "year": 2013
     63     },
     64     "property": "meetup"
     65   },
     66   {
     67     "description": "when teenth Tuesday is the 19th, the last day of the teenth week",
     68     "expected": "2013-03-19",
     69     "input": {
     70       "dayofweek": "Tuesday",
     71       "month": 3,
     72       "week": "teenth",
     73       "year": 2013
     74     },
     75     "property": "meetup"
     76   },
     77   {
     78     "description": "when teenth Tuesday is some day in the middle of the teenth week",
     79     "expected": "2013-04-16",
     80     "input": {
     81       "dayofweek": "Tuesday",
     82       "month": 4,
     83       "week": "teenth",
     84       "year": 2013
     85     },
     86     "property": "meetup"
     87   },
     88   {
     89     "description": "when teenth Tuesday is the 13th, the first day of the teenth week",
     90     "expected": "2013-08-13",
     91     "input": {
     92       "dayofweek": "Tuesday",
     93       "month": 8,
     94       "week": "teenth",
     95       "year": 2013
     96     },
     97     "property": "meetup"
     98   },
     99   {
    100     "description": "when teenth Wednesday is some day in the middle of the teenth week",
    101     "expected": "2013-01-16",
    102     "input": {
    103       "dayofweek": "Wednesday",
    104       "month": 1,
    105       "week": "teenth",
    106       "year": 2013
    107     },
    108     "property": "meetup"
    109   },
    110   {
    111     "description": "when teenth Wednesday is the 13th, the first day of the teenth week",
    112     "expected": "2013-02-13",
    113     "input": {
    114       "dayofweek": "Wednesday",
    115       "month": 2,
    116       "week": "teenth",
    117       "year": 2013
    118     },
    119     "property": "meetup"
    120   },
    121   {
    122     "description": "when teenth Wednesday is the 19th, the last day of the teenth week",
    123     "expected": "2013-06-19",
    124     "input": {
    125       "dayofweek": "Wednesday",
    126       "month": 6,
    127       "week": "teenth",
    128       "year": 2013
    129     },
    130     "property": "meetup"
    131   },
    132   {
    133     "description": "when teenth Thursday is some day in the middle of the teenth week",
    134     "expected": "2013-05-16",
    135     "input": {
    136       "dayofweek": "Thursday",
    137       "month": 5,
    138       "week": "teenth",
    139       "year": 2013
    140     },
    141     "property": "meetup"
    142   },
    143   {
    144     "description": "when teenth Thursday is the 13th, the first day of the teenth week",
    145     "expected": "2013-06-13",
    146     "input": {
    147       "dayofweek": "Thursday",
    148       "month": 6,
    149       "week": "teenth",
    150       "year": 2013
    151     },
    152     "property": "meetup"
    153   },
    154   {
    155     "description": "when teenth Thursday is the 19th, the last day of the teenth week",
    156     "expected": "2013-09-19",
    157     "input": {
    158       "dayofweek": "Thursday",
    159       "month": 9,
    160       "week": "teenth",
    161       "year": 2013
    162     },
    163     "property": "meetup"
    164   },
    165   {
    166     "description": "when teenth Friday is the 19th, the last day of the teenth week",
    167     "expected": "2013-04-19",
    168     "input": {
    169       "dayofweek": "Friday",
    170       "month": 4,
    171       "week": "teenth",
    172       "year": 2013
    173     },
    174     "property": "meetup"
    175   },
    176   {
    177     "description": "when teenth Friday is some day in the middle of the teenth week",
    178     "expected": "2013-08-16",
    179     "input": {
    180       "dayofweek": "Friday",
    181       "month": 8,
    182       "week": "teenth",
    183       "year": 2013
    184     },
    185     "property": "meetup"
    186   },
    187   {
    188     "description": "when teenth Friday is the 13th, the first day of the teenth week",
    189     "expected": "2013-09-13",
    190     "input": {
    191       "dayofweek": "Friday",
    192       "month": 9,
    193       "week": "teenth",
    194       "year": 2013
    195     },
    196     "property": "meetup"
    197   },
    198   {
    199     "description": "when teenth Saturday is some day in the middle of the teenth week",
    200     "expected": "2013-02-16",
    201     "input": {
    202       "dayofweek": "Saturday",
    203       "month": 2,
    204       "week": "teenth",
    205       "year": 2013
    206     },
    207     "property": "meetup"
    208   },
    209   {
    210     "description": "when teenth Saturday is the 13th, the first day of the teenth week",
    211     "expected": "2013-04-13",
    212     "input": {
    213       "dayofweek": "Saturday",
    214       "month": 4,
    215       "week": "teenth",
    216       "year": 2013
    217     },
    218     "property": "meetup"
    219   },
    220   {
    221     "description": "when teenth Saturday is the 19th, the last day of the teenth week",
    222     "expected": "2013-10-19",
    223     "input": {
    224       "dayofweek": "Saturday",
    225       "month": 10,
    226       "week": "teenth",
    227       "year": 2013
    228     },
    229     "property": "meetup"
    230   },
    231   {
    232     "description": "when teenth Sunday is the 19th, the last day of the teenth week",
    233     "expected": "2013-05-19",
    234     "input": {
    235       "dayofweek": "Sunday",
    236       "month": 5,
    237       "week": "teenth",
    238       "year": 2013
    239     },
    240     "property": "meetup"
    241   },
    242   {
    243     "description": "when teenth Sunday is some day in the middle of the teenth week",
    244     "expected": "2013-06-16",
    245     "input": {
    246       "dayofweek": "Sunday",
    247       "month": 6,
    248       "week": "teenth",
    249       "year": 2013
    250     },
    251     "property": "meetup"
    252   },
    253   {
    254     "description": "when teenth Sunday is the 13th, the first day of the teenth week",
    255     "expected": "2013-10-13",
    256     "input": {
    257       "dayofweek": "Sunday",
    258       "month": 10,
    259       "week": "teenth",
    260       "year": 2013
    261     },
    262     "property": "meetup"
    263   },
    264   {
    265     "description": "when first Monday is some day in the middle of the first week",
    266     "expected": "2013-03-04",
    267     "input": {
    268       "dayofweek": "Monday",
    269       "month": 3,
    270       "week": "first",
    271       "year": 2013
    272     },
    273     "property": "meetup"
    274   },
    275   {
    276     "description": "when first Monday is the 1st, the first day of the first week",
    277     "expected": "2013-04-01",
    278     "input": {
    279       "dayofweek": "Monday",
    280       "month": 4,
    281       "week": "first",
    282       "year": 2013
    283     },
    284     "property": "meetup"
    285   },
    286   {
    287     "description": "when first Tuesday is the 7th, the last day of the first week",
    288     "expected": "2013-05-07",
    289     "input": {
    290       "dayofweek": "Tuesday",
    291       "month": 5,
    292       "week": "first",
    293       "year": 2013
    294     },
    295     "property": "meetup"
    296   },
    297   {
    298     "description": "when first Tuesday is some day in the middle of the first week",
    299     "expected": "2013-06-04",
    300     "input": {
    301       "dayofweek": "Tuesday",
    302       "month": 6,
    303       "week": "first",
    304       "year": 2013
    305     },
    306     "property": "meetup"
    307   },
    308   {
    309     "description": "when first Wednesday is some day in the middle of the first week",
    310     "expected": "2013-07-03",
    311     "input": {
    312       "dayofweek": "Wednesday",
    313       "month": 7,
    314       "week": "first",
    315       "year": 2013
    316     },
    317     "property": "meetup"
    318   },
    319   {
    320     "description": "when first Wednesday is the 7th, the last day of the first week",
    321     "expected": "2013-08-07",
    322     "input": {
    323       "dayofweek": "Wednesday",
    324       "month": 8,
    325       "week": "first",
    326       "year": 2013
    327     },
    328     "property": "meetup"
    329   },
    330   {
    331     "description": "when first Thursday is some day in the middle of the first week",
    332     "expected": "2013-09-05",
    333     "input": {
    334       "dayofweek": "Thursday",
    335       "month": 9,
    336       "week": "first",
    337       "year": 2013
    338     },
    339     "property": "meetup"
    340   },
    341   {
    342     "description": "when first Thursday is another day in the middle of the first week",
    343     "expected": "2013-10-03",
    344     "input": {
    345       "dayofweek": "Thursday",
    346       "month": 10,
    347       "week": "first",
    348       "year": 2013
    349     },
    350     "property": "meetup"
    351   },
    352   {
    353     "description": "when first Friday is the 1st, the first day of the first week",
    354     "expected": "2013-11-01",
    355     "input": {
    356       "dayofweek": "Friday",
    357       "month": 11,
    358       "week": "first",
    359       "year": 2013
    360     },
    361     "property": "meetup"
    362   },
    363   {
    364     "description": "when first Friday is some day in the middle of the first week",
    365     "expected": "2013-12-06",
    366     "input": {
    367       "dayofweek": "Friday",
    368       "month": 12,
    369       "week": "first",
    370       "year": 2013
    371     },
    372     "property": "meetup"
    373   },
    374   {
    375     "description": "when first Saturday is some day in the middle of the first week",
    376     "expected": "2013-01-05",
    377     "input": {
    378       "dayofweek": "Saturday",
    379       "month": 1,
    380       "week": "first",
    381       "year": 2013
    382     },
    383     "property": "meetup"
    384   },
    385   {
    386     "description": "when first Saturday is another day in the middle of the first week",
    387     "expected": "2013-02-02",
    388     "input": {
    389       "dayofweek": "Saturday",
    390       "month": 2,
    391       "week": "first",
    392       "year": 2013
    393     },
    394     "property": "meetup"
    395   },
    396   {
    397     "description": "when first Sunday is some day in the middle of the first week",
    398     "expected": "2013-03-03",
    399     "input": {
    400       "dayofweek": "Sunday",
    401       "month": 3,
    402       "week": "first",
    403       "year": 2013
    404     },
    405     "property": "meetup"
    406   },
    407   {
    408     "description": "when first Sunday is the 7th, the last day of the first week",
    409     "expected": "2013-04-07",
    410     "input": {
    411       "dayofweek": "Sunday",
    412       "month": 4,
    413       "week": "first",
    414       "year": 2013
    415     },
    416     "property": "meetup"
    417   },
    418   {
    419     "description": "when second Monday is some day in the middle of the second week",
    420     "expected": "2013-03-11",
    421     "input": {
    422       "dayofweek": "Monday",
    423       "month": 3,
    424       "week": "second",
    425       "year": 2013
    426     },
    427     "property": "meetup"
    428   },
    429   {
    430     "description": "when second Monday is the 8th, the first day of the second week",
    431     "expected": "2013-04-08",
    432     "input": {
    433       "dayofweek": "Monday",
    434       "month": 4,
    435       "week": "second",
    436       "year": 2013
    437     },
    438     "property": "meetup"
    439   },
    440   {
    441     "description": "when second Tuesday is the 14th, the last day of the second week",
    442     "expected": "2013-05-14",
    443     "input": {
    444       "dayofweek": "Tuesday",
    445       "month": 5,
    446       "week": "second",
    447       "year": 2013
    448     },
    449     "property": "meetup"
    450   },
    451   {
    452     "description": "when second Tuesday is some day in the middle of the second week",
    453     "expected": "2013-06-11",
    454     "input": {
    455       "dayofweek": "Tuesday",
    456       "month": 6,
    457       "week": "second",
    458       "year": 2013
    459     },
    460     "property": "meetup"
    461   },
    462   {
    463     "description": "when second Wednesday is some day in the middle of the second week",
    464     "expected": "2013-07-10",
    465     "input": {
    466       "dayofweek": "Wednesday",
    467       "month": 7,
    468       "week": "second",
    469       "year": 2013
    470     },
    471     "property": "meetup"
    472   },
    473   {
    474     "description": "when second Wednesday is the 14th, the last day of the second week",
    475     "expected": "2013-08-14",
    476     "input": {
    477       "dayofweek": "Wednesday",
    478       "month": 8,
    479       "week": "second",
    480       "year": 2013
    481     },
    482     "property": "meetup"
    483   },
    484   {
    485     "description": "when second Thursday is some day in the middle of the second week",
    486     "expected": "2013-09-12",
    487     "input": {
    488       "dayofweek": "Thursday",
    489       "month": 9,
    490       "week": "second",
    491       "year": 2013
    492     },
    493     "property": "meetup"
    494   },
    495   {
    496     "description": "when second Thursday is another day in the middle of the second week",
    497     "expected": "2013-10-10",
    498     "input": {
    499       "dayofweek": "Thursday",
    500       "month": 10,
    501       "week": "second",
    502       "year": 2013
    503     },
    504     "property": "meetup"
    505   },
    506   {
    507     "description": "when second Friday is the 8th, the first day of the second week",
    508     "expected": "2013-11-08",
    509     "input": {
    510       "dayofweek": "Friday",
    511       "month": 11,
    512       "week": "second",
    513       "year": 2013
    514     },
    515     "property": "meetup"
    516   },
    517   {
    518     "description": "when second Friday is some day in the middle of the second week",
    519     "expected": "2013-12-13",
    520     "input": {
    521       "dayofweek": "Friday",
    522       "month": 12,
    523       "week": "second",
    524       "year": 2013
    525     },
    526     "property": "meetup"
    527   },
    528   {
    529     "description": "when second Saturday is some day in the middle of the second week",
    530     "expected": "2013-01-12",
    531     "input": {
    532       "dayofweek": "Saturday",
    533       "month": 1,
    534       "week": "second",
    535       "year": 2013
    536     },
    537     "property": "meetup"
    538   },
    539   {
    540     "description": "when second Saturday is another day in the middle of the second week",
    541     "expected": "2013-02-09",
    542     "input": {
    543       "dayofweek": "Saturday",
    544       "month": 2,
    545       "week": "second",
    546       "year": 2013
    547     },
    548     "property": "meetup"
    549   },
    550   {
    551     "description": "when second Sunday is some day in the middle of the second week",
    552     "expected": "2013-03-10",
    553     "input": {
    554       "dayofweek": "Sunday",
    555       "month": 3,
    556       "week": "second",
    557       "year": 2013
    558     },
    559     "property": "meetup"
    560   },
    561   {
    562     "description": "when second Sunday is the 14th, the last day of the second week",
    563     "expected": "2013-04-14",
    564     "input": {
    565       "dayofweek": "Sunday",
    566       "month": 4,
    567       "week": "second",
    568       "year": 2013
    569     },
    570     "property": "meetup"
    571   },
    572   {
    573     "description": "when third Monday is some day in the middle of the third week",
    574     "expected": "2013-03-18",
    575     "input": {
    576       "dayofweek": "Monday",
    577       "month": 3,
    578       "week": "third",
    579       "year": 2013
    580     },
    581     "property": "meetup"
    582   },
    583   {
    584     "description": "when third Monday is the 15th, the first day of the third week",
    585     "expected": "2013-04-15",
    586     "input": {
    587       "dayofweek": "Monday",
    588       "month": 4,
    589       "week": "third",
    590       "year": 2013
    591     },
    592     "property": "meetup"
    593   },
    594   {
    595     "description": "when third Tuesday is the 21st, the last day of the third week",
    596     "expected": "2013-05-21",
    597     "input": {
    598       "dayofweek": "Tuesday",
    599       "month": 5,
    600       "week": "third",
    601       "year": 2013
    602     },
    603     "property": "meetup"
    604   },
    605   {
    606     "description": "when third Tuesday is some day in the middle of the third week",
    607     "expected": "2013-06-18",
    608     "input": {
    609       "dayofweek": "Tuesday",
    610       "month": 6,
    611       "week": "third",
    612       "year": 2013
    613     },
    614     "property": "meetup"
    615   },
    616   {
    617     "description": "when third Wednesday is some day in the middle of the third week",
    618     "expected": "2013-07-17",
    619     "input": {
    620       "dayofweek": "Wednesday",
    621       "month": 7,
    622       "week": "third",
    623       "year": 2013
    624     },
    625     "property": "meetup"
    626   },
    627   {
    628     "description": "when third Wednesday is the 21st, the last day of the third week",
    629     "expected": "2013-08-21",
    630     "input": {
    631       "dayofweek": "Wednesday",
    632       "month": 8,
    633       "week": "third",
    634       "year": 2013
    635     },
    636     "property": "meetup"
    637   },
    638   {
    639     "description": "when third Thursday is some day in the middle of the third week",
    640     "expected": "2013-09-19",
    641     "input": {
    642       "dayofweek": "Thursday",
    643       "month": 9,
    644       "week": "third",
    645       "year": 2013
    646     },
    647     "property": "meetup"
    648   },
    649   {
    650     "description": "when third Thursday is another day in the middle of the third week",
    651     "expected": "2013-10-17",
    652     "input": {
    653       "dayofweek": "Thursday",
    654       "month": 10,
    655       "week": "third",
    656       "year": 2013
    657     },
    658     "property": "meetup"
    659   },
    660   {
    661     "description": "when third Friday is the 15th, the first day of the third week",
    662     "expected": "2013-11-15",
    663     "input": {
    664       "dayofweek": "Friday",
    665       "month": 11,
    666       "week": "third",
    667       "year": 2013
    668     },
    669     "property": "meetup"
    670   },
    671   {
    672     "description": "when third Friday is some day in the middle of the third week",
    673     "expected": "2013-12-20",
    674     "input": {
    675       "dayofweek": "Friday",
    676       "month": 12,
    677       "week": "third",
    678       "year": 2013
    679     },
    680     "property": "meetup"
    681   },
    682   {
    683     "description": "when third Saturday is some day in the middle of the third week",
    684     "expected": "2013-01-19",
    685     "input": {
    686       "dayofweek": "Saturday",
    687       "month": 1,
    688       "week": "third",
    689       "year": 2013
    690     },
    691     "property": "meetup"
    692   },
    693   {
    694     "description": "when third Saturday is another day in the middle of the third week",
    695     "expected": "2013-02-16",
    696     "input": {
    697       "dayofweek": "Saturday",
    698       "month": 2,
    699       "week": "third",
    700       "year": 2013
    701     },
    702     "property": "meetup"
    703   },
    704   {
    705     "description": "when third Sunday is some day in the middle of the third week",
    706     "expected": "2013-03-17",
    707     "input": {
    708       "dayofweek": "Sunday",
    709       "month": 3,
    710       "week": "third",
    711       "year": 2013
    712     },
    713     "property": "meetup"
    714   },
    715   {
    716     "description": "when third Sunday is the 21st, the last day of the third week",
    717     "expected": "2013-04-21",
    718     "input": {
    719       "dayofweek": "Sunday",
    720       "month": 4,
    721       "week": "third",
    722       "year": 2013
    723     },
    724     "property": "meetup"
    725   },
    726   {
    727     "description": "when fourth Monday is some day in the middle of the fourth week",
    728     "expected": "2013-03-25",
    729     "input": {
    730       "dayofweek": "Monday",
    731       "month": 3,
    732       "week": "fourth",
    733       "year": 2013
    734     },
    735     "property": "meetup"
    736   },
    737   {
    738     "description": "when fourth Monday is the 22nd, the first day of the fourth week",
    739     "expected": "2013-04-22",
    740     "input": {
    741       "dayofweek": "Monday",
    742       "month": 4,
    743       "week": "fourth",
    744       "year": 2013
    745     },
    746     "property": "meetup"
    747   },
    748   {
    749     "description": "when fourth Tuesday is the 28th, the last day of the fourth week",
    750     "expected": "2013-05-28",
    751     "input": {
    752       "dayofweek": "Tuesday",
    753       "month": 5,
    754       "week": "fourth",
    755       "year": 2013
    756     },
    757     "property": "meetup"
    758   },
    759   {
    760     "description": "when fourth Tuesday is some day in the middle of the fourth week",
    761     "expected": "2013-06-25",
    762     "input": {
    763       "dayofweek": "Tuesday",
    764       "month": 6,
    765       "week": "fourth",
    766       "year": 2013
    767     },
    768     "property": "meetup"
    769   },
    770   {
    771     "description": "when fourth Wednesday is some day in the middle of the fourth week",
    772     "expected": "2013-07-24",
    773     "input": {
    774       "dayofweek": "Wednesday",
    775       "month": 7,
    776       "week": "fourth",
    777       "year": 2013
    778     },
    779     "property": "meetup"
    780   },
    781   {
    782     "description": "when fourth Wednesday is the 28th, the last day of the fourth week",
    783     "expected": "2013-08-28",
    784     "input": {
    785       "dayofweek": "Wednesday",
    786       "month": 8,
    787       "week": "fourth",
    788       "year": 2013
    789     },
    790     "property": "meetup"
    791   },
    792   {
    793     "description": "when fourth Thursday is some day in the middle of the fourth week",
    794     "expected": "2013-09-26",
    795     "input": {
    796       "dayofweek": "Thursday",
    797       "month": 9,
    798       "week": "fourth",
    799       "year": 2013
    800     },
    801     "property": "meetup"
    802   },
    803   {
    804     "description": "when fourth Thursday is another day in the middle of the fourth week",
    805     "expected": "2013-10-24",
    806     "input": {
    807       "dayofweek": "Thursday",
    808       "month": 10,
    809       "week": "fourth",
    810       "year": 2013
    811     },
    812     "property": "meetup"
    813   },
    814   {
    815     "description": "when fourth Friday is the 22nd, the first day of the fourth week",
    816     "expected": "2013-11-22",
    817     "input": {
    818       "dayofweek": "Friday",
    819       "month": 11,
    820       "week": "fourth",
    821       "year": 2013
    822     },
    823     "property": "meetup"
    824   },
    825   {
    826     "description": "when fourth Friday is some day in the middle of the fourth week",
    827     "expected": "2013-12-27",
    828     "input": {
    829       "dayofweek": "Friday",
    830       "month": 12,
    831       "week": "fourth",
    832       "year": 2013
    833     },
    834     "property": "meetup"
    835   },
    836   {
    837     "description": "when fourth Saturday is some day in the middle of the fourth week",
    838     "expected": "2013-01-26",
    839     "input": {
    840       "dayofweek": "Saturday",
    841       "month": 1,
    842       "week": "fourth",
    843       "year": 2013
    844     },
    845     "property": "meetup"
    846   },
    847   {
    848     "description": "when fourth Saturday is another day in the middle of the fourth week",
    849     "expected": "2013-02-23",
    850     "input": {
    851       "dayofweek": "Saturday",
    852       "month": 2,
    853       "week": "fourth",
    854       "year": 2013
    855     },
    856     "property": "meetup"
    857   },
    858   {
    859     "description": "when fourth Sunday is some day in the middle of the fourth week",
    860     "expected": "2013-03-24",
    861     "input": {
    862       "dayofweek": "Sunday",
    863       "month": 3,
    864       "week": "fourth",
    865       "year": 2013
    866     },
    867     "property": "meetup"
    868   },
    869   {
    870     "description": "when fourth Sunday is the 28th, the last day of the fourth week",
    871     "expected": "2013-04-28",
    872     "input": {
    873       "dayofweek": "Sunday",
    874       "month": 4,
    875       "week": "fourth",
    876       "year": 2013
    877     },
    878     "property": "meetup"
    879   },
    880   {
    881     "description": "last Monday in a month with four Mondays",
    882     "expected": "2013-03-25",
    883     "input": {
    884       "dayofweek": "Monday",
    885       "month": 3,
    886       "week": "last",
    887       "year": 2013
    888     },
    889     "property": "meetup"
    890   },
    891   {
    892     "description": "last Monday in a month with five Mondays",
    893     "expected": "2013-04-29",
    894     "input": {
    895       "dayofweek": "Monday",
    896       "month": 4,
    897       "week": "last",
    898       "year": 2013
    899     },
    900     "property": "meetup"
    901   },
    902   {
    903     "description": "last Tuesday in a month with four Tuesdays",
    904     "expected": "2013-05-28",
    905     "input": {
    906       "dayofweek": "Tuesday",
    907       "month": 5,
    908       "week": "last",
    909       "year": 2013
    910     },
    911     "property": "meetup"
    912   },
    913   {
    914     "description": "last Tuesday in another month with four Tuesdays",
    915     "expected": "2013-06-25",
    916     "input": {
    917       "dayofweek": "Tuesday",
    918       "month": 6,
    919       "week": "last",
    920       "year": 2013
    921     },
    922     "property": "meetup"
    923   },
    924   {
    925     "description": "last Wednesday in a month with five Wednesdays",
    926     "expected": "2013-07-31",
    927     "input": {
    928       "dayofweek": "Wednesday",
    929       "month": 7,
    930       "week": "last",
    931       "year": 2013
    932     },
    933     "property": "meetup"
    934   },
    935   {
    936     "description": "last Wednesday in a month with four Wednesdays",
    937     "expected": "2013-08-28",
    938     "input": {
    939       "dayofweek": "Wednesday",
    940       "month": 8,
    941       "week": "last",
    942       "year": 2013
    943     },
    944     "property": "meetup"
    945   },
    946   {
    947     "description": "last Thursday in a month with four Thursdays",
    948     "expected": "2013-09-26",
    949     "input": {
    950       "dayofweek": "Thursday",
    951       "month": 9,
    952       "week": "last",
    953       "year": 2013
    954     },
    955     "property": "meetup"
    956   },
    957   {
    958     "description": "last Thursday in a month with five Thursdays",
    959     "expected": "2013-10-31",
    960     "input": {
    961       "dayofweek": "Thursday",
    962       "month": 10,
    963       "week": "last",
    964       "year": 2013
    965     },
    966     "property": "meetup"
    967   },
    968   {
    969     "description": "last Friday in a month with five Fridays",
    970     "expected": "2013-11-29",
    971     "input": {
    972       "dayofweek": "Friday",
    973       "month": 11,
    974       "week": "last",
    975       "year": 2013
    976     },
    977     "property": "meetup"
    978   },
    979   {
    980     "description": "last Friday in a month with four Fridays",
    981     "expected": "2013-12-27",
    982     "input": {
    983       "dayofweek": "Friday",
    984       "month": 12,
    985       "week": "last",
    986       "year": 2013
    987     },
    988     "property": "meetup"
    989   },
    990   {
    991     "description": "last Saturday in a month with four Saturdays",
    992     "expected": "2013-01-26",
    993     "input": {
    994       "dayofweek": "Saturday",
    995       "month": 1,
    996       "week": "last",
    997       "year": 2013
    998     },
    999     "property": "meetup"
   1000   },
   1001   {
   1002     "description": "last Saturday in another month with four Saturdays",
   1003     "expected": "2013-02-23",
   1004     "input": {
   1005       "dayofweek": "Saturday",
   1006       "month": 2,
   1007       "week": "last",
   1008       "year": 2013
   1009     },
   1010     "property": "meetup"
   1011   },
   1012   {
   1013     "description": "last Sunday in a month with five Sundays",
   1014     "expected": "2013-03-31",
   1015     "input": {
   1016       "dayofweek": "Sunday",
   1017       "month": 3,
   1018       "week": "last",
   1019       "year": 2013
   1020     },
   1021     "property": "meetup"
   1022   },
   1023   {
   1024     "description": "last Sunday in a month with four Sundays",
   1025     "expected": "2013-04-28",
   1026     "input": {
   1027       "dayofweek": "Sunday",
   1028       "month": 4,
   1029       "week": "last",
   1030       "year": 2013
   1031     },
   1032     "property": "meetup"
   1033   },
   1034   {
   1035     "description": "when last Wednesday in February in a leap year is the 29th",
   1036     "expected": "2012-02-29",
   1037     "input": {
   1038       "dayofweek": "Wednesday",
   1039       "month": 2,
   1040       "week": "last",
   1041       "year": 2012
   1042     },
   1043     "property": "meetup"
   1044   },
   1045   {
   1046     "description": "last Wednesday in December that is also the last day of the year",
   1047     "expected": "2014-12-31",
   1048     "input": {
   1049       "dayofweek": "Wednesday",
   1050       "month": 12,
   1051       "week": "last",
   1052       "year": 2014
   1053     },
   1054     "property": "meetup"
   1055   },
   1056   {
   1057     "description": "when last Sunday in February in a non-leap year is not the 29th",
   1058     "expected": "2015-02-22",
   1059     "input": {
   1060       "dayofweek": "Sunday",
   1061       "month": 2,
   1062       "week": "last",
   1063       "year": 2015
   1064     },
   1065     "property": "meetup"
   1066   },
   1067   {
   1068     "description": "when first Friday is the 7th, the last day of the first week",
   1069     "expected": "2012-12-07",
   1070     "input": {
   1071       "dayofweek": "Friday",
   1072       "month": 12,
   1073       "week": "first",
   1074       "year": 2012
   1075     },
   1076     "property": "meetup"
   1077   }
   1078 ]