"Fossies" - the Fresh Open Source Software Archive

Member "Date-Calc-6.4/t/f027.t" (7 Mar 2015, 7742 Bytes) of package /linux/privat/Date-Calc-6.4.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "f027.t": 6.3_vs_6.4.

    1 #!perl -w
    2 
    3 BEGIN { eval { require bytes; }; }
    4 use strict;
    5 no strict "vars";
    6 
    7 BEGIN { $Date::Calc::XS_DISABLE = $Date::Calc::XS_DISABLE = 1; }
    8 
    9 use Date::Calc qw( Decode_Date_US2 Language Decode_Language );
   10 
   11 # ======================================================================
   12 #   ($year,$mm,$dd) = Decode_Date_US2($date);
   13 # ======================================================================
   14 
   15 print "1..46\n";
   16 
   17 $n = 1;
   18 unless (($year,$mm,$dd) = Decode_Date_US2(""))
   19 {print "ok $n\n";} else {print "not ok $n\n";}
   20 $n++;
   21 
   22 unless (($year,$mm,$dd) = Decode_Date_US2("__"))
   23 {print "ok $n\n";} else {print "not ok $n\n";}
   24 $n++;
   25 
   26 unless (($year,$mm,$dd) = Decode_Date_US2("_13_"))
   27 {print "ok $n\n";} else {print "not ok $n\n";}
   28 $n++;
   29 
   30 if ((($year,$mm,$dd) = Decode_Date_US2("_134_")) &&
   31 ($year==2004) && ($mm==1) && ($dd==3))
   32 {print "ok $n\n";} else {print "not ok $n\n";}
   33 $n++;
   34 
   35 if ((($year,$mm,$dd) = Decode_Date_US2("_0134_")) &&
   36 ($year==2004) && ($mm==1) && ($dd==3))
   37 {print "ok $n\n";} else {print "not ok $n\n";}
   38 $n++;
   39 
   40 if ((($year,$mm,$dd) = Decode_Date_US2("_00134_")) &&
   41 ($year==2004) && ($mm==1) && ($dd==3))
   42 {print "ok $n\n";} else {print "not ok $n\n";}
   43 $n++;
   44 
   45 if ((($year,$mm,$dd) = Decode_Date_US2("_1364_")) &&
   46 (int($year/100)>19) && ($year%100==64) && ($mm==1) && ($dd==3))
   47 {print "ok $n\n";} else {print "not ok $n\n";}
   48 $n++;
   49 
   50 if ((($year,$mm,$dd) = Decode_Date_US2("_01364_")) &&
   51 (int($year/100)>19) && ($year%100==64) && ($mm==1) && ($dd==3))
   52 {print "ok $n\n";} else {print "not ok $n\n";}
   53 $n++;
   54 
   55 if ((($year,$mm,$dd) = Decode_Date_US2("_001364_")) &&
   56 (int($year/100)>19) && ($year%100==64) && ($mm==1) && ($dd==3))
   57 {print "ok $n\n";} else {print "not ok $n\n";}
   58 $n++;
   59 
   60 if ((($year,$mm,$dd) = Decode_Date_US2("_10364_")) &&
   61 (int($year/100)>19) && ($year%100==64) && ($mm==1) && ($dd==3))
   62 {print "ok $n\n";} else {print "not ok $n\n";}
   63 $n++;
   64 
   65 if ((($year,$mm,$dd) = Decode_Date_US2("_010364_")) &&
   66 (int($year/100)>19) && ($year%100==64) && ($mm==1) && ($dd==3))
   67 {print "ok $n\n";} else {print "not ok $n\n";}
   68 $n++;
   69 
   70 if ((($year,$mm,$dd) = Decode_Date_US2("_0010364_")) &&
   71 (int($year/100)>19) && ($year%100==64) && ($mm==1) && ($dd==3))
   72 {print "ok $n\n";} else {print "not ok $n\n";}
   73 $n++;
   74 
   75 if ((($year,$mm,$dd) = Decode_Date_US2("_110364_")) &&
   76 (int($year/100)>19) && ($year%100==64) && ($mm==11) && ($dd==3))
   77 {print "ok $n\n";} else {print "not ok $n\n";}
   78 $n++;
   79 
   80 if ((($year,$mm,$dd) = Decode_Date_US2("_0110364_")) &&
   81 (int($year/100)>19) && ($year%100==64) && ($mm==11) && ($dd==3))
   82 {print "ok $n\n";} else {print "not ok $n\n";}
   83 $n++;
   84 
   85 if ((($year,$mm,$dd) = Decode_Date_US2("_00110364_")) &&
   86 (int($year/100)>19) && ($year%100==64) && ($mm==11) && ($dd==3))
   87 {print "ok $n\n";} else {print "not ok $n\n";}
   88 $n++;
   89 
   90 if ((($year,$mm,$dd) = Decode_Date_US2("_1031964_")) &&
   91 ($year==1964) && ($mm==1) && ($dd==3))
   92 {print "ok $n\n";} else {print "not ok $n\n";}
   93 $n++;
   94 
   95 if ((($year,$mm,$dd) = Decode_Date_US2("_01031964_")) &&
   96 ($year==1964) && ($mm==1) && ($dd==3))
   97 {print "ok $n\n";} else {print "not ok $n\n";}
   98 $n++;
   99 
  100 if ((($year,$mm,$dd) = Decode_Date_US2("_001031964_")) &&
  101 ($year==1964) && ($mm==1) && ($dd==3))
  102 {print "ok $n\n";} else {print "not ok $n\n";}
  103 $n++;
  104 
  105 if ((($year,$mm,$dd) = Decode_Date_US2("_11031964_")) &&
  106 ($year==1964) && ($mm==11) && ($dd==3))
  107 {print "ok $n\n";} else {print "not ok $n\n";}
  108 $n++;
  109 
  110 if ((($year,$mm,$dd) = Decode_Date_US2("_011031964_")) &&
  111 ($year==1964) && ($mm==11) && ($dd==3))
  112 {print "ok $n\n";} else {print "not ok $n\n";}
  113 $n++;
  114 
  115 if ((($year,$mm,$dd) = Decode_Date_US2("_0011031964_")) &&
  116 ($year==1964) && ($mm==11) && ($dd==3))
  117 {print "ok $n\n";} else {print "not ok $n\n";}
  118 $n++;
  119 
  120 if ((($year,$mm,$dd) = Decode_Date_US2("_1_3_64_")) &&
  121 (int($year/100)>19) && ($year%100==64) && ($mm==1) && ($dd==3))
  122 {print "ok $n\n";} else {print "not ok $n\n";}
  123 $n++;
  124 
  125 if ((($year,$mm,$dd) = Decode_Date_US2("_1_3_1964_")) &&
  126 ($year==1964) && ($mm==1) && ($dd==3))
  127 {print "ok $n\n";} else {print "not ok $n\n";}
  128 $n++;
  129 
  130 if ((($year,$mm,$dd) = Decode_Date_US2("_jan_3_64_")) &&
  131 (int($year/100)>19) && ($year%100==64) && ($mm==1) && ($dd==3))
  132 {print "ok $n\n";} else {print "not ok $n\n";}
  133 $n++;
  134 
  135 if ((($year,$mm,$dd) = Decode_Date_US2("_Jan_3_64_")) &&
  136 (int($year/100)>19) && ($year%100==64) && ($mm==1) && ($dd==3))
  137 {print "ok $n\n";} else {print "not ok $n\n";}
  138 $n++;
  139 
  140 if ((($year,$mm,$dd) = Decode_Date_US2("_jAN_3_64_")) &&
  141 (int($year/100)>19) && ($year%100==64) && ($mm==1) && ($dd==3))
  142 {print "ok $n\n";} else {print "not ok $n\n";}
  143 $n++;
  144 
  145 if ((($year,$mm,$dd) = Decode_Date_US2("_January_3_64_")) &&
  146 (int($year/100)>19) && ($year%100==64) && ($mm==1) && ($dd==3))
  147 {print "ok $n\n";} else {print "not ok $n\n";}
  148 $n++;
  149 
  150 unless (($year,$mm,$dd) = Decode_Date_US2("_j_3_64_"))
  151 {print "ok $n\n";} else {print "not ok $n\n";}
  152 $n++;
  153 
  154 if ((($year,$mm,$dd) = Decode_Date_US2(" January 3rd, 1964 ")) &&
  155 ($year==1964) && ($mm==1) && ($dd==3))
  156 {print "ok $n\n";} else {print "not ok $n\n";}
  157 $n++;
  158 
  159 if ((($year,$mm,$dd) = Decode_Date_US2("_Jan364_")) &&
  160 (int($year/100)>19) && ($year%100==64) && ($mm==1) && ($dd==3))
  161 {print "ok $n\n";} else {print "not ok $n\n";}
  162 $n++;
  163 
  164 if ((($year,$mm,$dd) = Decode_Date_US2("_Jan0364_")) &&
  165 (int($year/100)>19) && ($year%100==64) && ($mm==1) && ($dd==3))
  166 {print "ok $n\n";} else {print "not ok $n\n";}
  167 $n++;
  168 
  169 if ((($year,$mm,$dd) = Decode_Date_US2("_Jan00364_")) &&
  170 (int($year/100)>19) && ($year%100==64) && ($mm==1) && ($dd==3))
  171 {print "ok $n\n";} else {print "not ok $n\n";}
  172 $n++;
  173 
  174 if ((($year,$mm,$dd) = Decode_Date_US2("_Jan2264_")) &&
  175 (int($year/100)>19) && ($year%100==64) && ($mm==1) && ($dd==22))
  176 {print "ok $n\n";} else {print "not ok $n\n";}
  177 $n++;
  178 
  179 if ((($year,$mm,$dd) = Decode_Date_US2("_Jan02264_",0)) &&
  180 (int($year/100)>19) && ($year%100==64) && ($mm==1) && ($dd==22))
  181 {print "ok $n\n";} else {print "not ok $n\n";}
  182 $n++;
  183 
  184 if ((($year,$mm,$dd) = Decode_Date_US2("_Jan002264_",'')) &&
  185 (int($year/100)>19) && ($year%100==64) && ($mm==1) && ($dd==22))
  186 {print "ok $n\n";} else {print "not ok $n\n";}
  187 $n++;
  188 
  189 if ((($year,$mm,$dd) = Decode_Date_US2("_ja31964_",1)) &&
  190 ($year==1964) && ($mm==1) && ($dd==3))
  191 {print "ok $n\n";} else {print "not ok $n\n";}
  192 $n++;
  193 
  194 if ((($year,$mm,$dd) = Decode_Date_US2("_ja031964_",2)) &&
  195 ($year==1964) && ($mm==1) && ($dd==3))
  196 {print "ok $n\n";} else {print "not ok $n\n";}
  197 $n++;
  198 
  199 if ((($year,$mm,$dd) = Decode_Date_US2("_ja0031964_",3)) &&
  200 ($year==1964) && ($mm==1) && ($dd==3))
  201 {print "ok $n\n";} else {print "not ok $n\n";}
  202 $n++;
  203 
  204 if ((($year,$mm,$dd) = Decode_Date_US2("_ja221964_",undef)) &&
  205 ($year==1964) && ($mm==1) && ($dd==22))
  206 {print "ok $n\n";} else {print "not ok $n\n";}
  207 $n++;
  208 
  209 if ((($year,$mm,$dd) = Decode_Date_US2("_ja0221964_")) &&
  210 ($year==1964) && ($mm==1) && ($dd==22))
  211 {print "ok $n\n";} else {print "not ok $n\n";}
  212 $n++;
  213 
  214 if ((($year,$mm,$dd) = Decode_Date_US2("_ja00221964_")) &&
  215 ($year==1964) && ($mm==1) && ($dd==22))
  216 {print "ok $n\n";} else {print "not ok $n\n";}
  217 $n++;
  218 
  219 unless (($year,$mm,$dd) = Decode_Date_US2("_ja3364_"))
  220 {print "ok $n\n";} else {print "not ok $n\n";}
  221 $n++;
  222 
  223 unless (($year,$mm,$dd) = Decode_Date_US2("_ja331964_"))
  224 {print "ok $n\n";} else {print "not ok $n\n";}
  225 $n++;
  226 
  227 if ((($year,$mm,$dd) = Decode_Date_US2("x000001x000003x000064x")) &&
  228 (int($year/100)>19) && ($year%100==64) && ($mm==1) && ($dd==3))
  229 {print "ok $n\n";} else {print "not ok $n\n";}
  230 $n++;
  231 
  232 if ((($year,$mm,$dd) = Decode_Date_US2("_ja_000003x000064x")) &&
  233 (int($year/100)>19) && ($year%100==64) && ($mm==1) && ($dd==3))
  234 {print "ok $n\n";} else {print "not ok $n\n";}
  235 $n++;
  236 
  237 if ((($year,$mm,$dd) = Decode_Date_US2("_Janeiro_3_dia_tres_de_janeiro_de_1964_mil_novecentos_sessenta_e_seis_",Decode_Language("Portug"))) &&
  238 ($year==1964) && ($mm==1) && ($dd==3))
  239 {print "ok $n\n";} else {print "not ok $n\n";}
  240 $n++;
  241 
  242 __END__
  243