From pate@users.sourceforge.net Thu Apr 25 18:29:32 2002 From: Pat Eyler To: koha-devel@lists.koha-community.org Subject: [Koha-devel] CVS: koha/t format.t,NONE,1.1.2.1 koha.t,NONE,1.1.2.1 output.t,NONE,1.1.2.1 Date: Thu, 25 Apr 2002 18:30:04 +0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3096324290821885821==" --===============3096324290821885821== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Update of /cvsroot/koha/koha/t In directory usw-pr-cvs1:/tmp/cvs-serv15626/t Added Files: Tag: rel-1-2 format.t koha.t output.t=20 Log Message: restructured tests into a separate directory --- NEW FILE --- BEGIN { $| =3D 1; print "1..5\n"; } END {print "not ok 1\n" unless $loaded;} use C4::Format; $loaded =3D 1; print "ok 1\n"; # # ensure &startint returns a reasonable value # # try right formatting if (" foo" eq fmtstr('','foo','R5')) { print "ok 2\n"; } else { print "not ok 2\n"; } # try left formatting if ("foo " eq fmtstr('','foo','L5')) { print "ok 3\n"; } else { print "not ok 3\n"; } # try centering with even spacing if (" foo " eq fmtstr('','foo','C5')) { print "ok 4\n"; } else { print "not ok 4\n"; } # try centering with uneven spacing if ("foo " eq fmtstr('','foo','C4')) { print "ok 5\n"; } else { print "not ok 5\n"; } --- NEW FILE --- BEGIN { $| =3D 1; print "1..6\n"; } END {print "not ok 1\n" unless $loaded;} use C4::Koha; $loaded =3D 1; print "ok 1\n"; # # test that &slashifyDate returns correct (non-US) date # $date =3D "01/01/2002"; $newdate =3D &slashifyDate("2002-01-01"); if ($date eq $newdate) { print "ok 2\n"; } else { print "not ok 2\n"; } # # Check that &fixEthnicity returns correct values # if ('Maori' eq fixEthnicity('maori')) { print "ok 3\n"; } else { print "not ok 3\n"; } if ('European/Pakeha' eq fixEthnicity('european')) { print "ok 4\n"; } else { print "not ok 4\n"; } if ('Pacific Islander' eq fixEthnicity('pi')) { print "ok 5\n"; } else { print "not ok 5\n"; } if ('Asian' eq fixEthnicity('asian')) { print "ok 6\n"; } else { print "not ok 6\n"; } --- NEW FILE --- BEGIN { $| =3D 1; print "1..25\n"; } END {print "not ok 1\n" unless $loaded;} use C4::Output; $loaded =3D 1; print "ok 1\n"; # # ensure &startpage returns correct value # if ("\n" eq startpage()) { print "ok 2\n"; } else { print "not ok 2\n"; } # # Check that &gotopage returns proper value # if ("" eq gotopage(= 'foo')) { print "ok 3\n"; } else { print "not ok 3\n"; } # # skipping &startmenu for now # # # skipping &endmenu for now # # ensure &mktablehdr returns a proper value # if ("\n" eq mktablehdr()) { print "ok 4\n"; } else { print "not ok 4\n"; } # # ensure &mktablerow returns a proper value # # 1 row, no background image if ("\n" eq mktablerow(1,'red','text')) { print "ok 5\n"; } else {=20 print "not ok 5\n"; } # 1 row, background image if ("\n" eq mktablerow(1,'red','text','foo.jpg')) { print "ok 6\n"; } else { print "not ok 6\n"; } #2 rows, no background image if ("\n" eq mktablerow(2,'red','text','text')) { print "ok 7\n"; } else { print "not ok 7\n"; } # 2 rows, background image if ("text\n" eq=20 mktablerow(2,'red','text','text', 'foo.jpg')) { print "ok 8\n"; } else { print "not ok 8\n"; } # # ensure mktableft returns the proper value # if ("
text
text
texttext
text
\n" eq mktableft()) { print "ok 9\n"; } else { print "not ok 9\n"; } # # skipping mkform for now # # # skipping mkform3 for now # # # skipping mkform2 for now # # # ensure endpage returns the proper value # if ("\n" eq endpage()) { print "ok 10\n"; } else { print "not ok 10\n"; } # # ensure mklink returns the right value # if ("foo" eq mklink('foo.html', 'foo')) { print "ok 11\n"; } else { print "not ok 11\n"; } # # ensure mkheadr returns the proper value # if ("foo
" eq mkheadr(1,'foo')) { print "ok 12\n"; } else { print "not ok 12\n"; } if ("foo" eq mkheadr(2,'foo')) { print "ok 13\n"; } else { print "not ok 13\n"; } if ("foo

" eq mkheadr(3,'foo')) { print "ok 14\n"; } else { print "not ok 14\n"; } # # test ¢er and &endcenter # if ("

\n" eq center()) { print "ok 15\n"; } else {=20 print "not ok15\n"; } if ("
\n" eq endcenter()) { print "ok 16\n"; } else {=20 print "not ok 16\n"; } # # ensure bold returns proper value # if ("foo" eq bold('foo')) { print "ok 17\n"; } else { print "not ok\n"; } # # ensure &mkformnotable returns a valid value # @inputHidden =3D qw(hidden hiddenname hiddenvalue); @inputRadio =3D qw(radio radioname radiovalue); @inputText =3D qw(text textname textvalue); @inputTextarea =3D qw(textarea textareaname textareavalue); @inputSubmit =3D qw(submit submitname submitvalue); @inputReset =3D qw(reset resetname resetvalue); # 1 input; hidden @inputs =3D (\@inputHidden); $return =3D"
\n"; $return .=3D "= \n"; $return .=3D "
"; if ($return eq mkformnotable('actionurl', @inputs)) { print "ok 18\n"; } else { print "not ok 18\n"; } # 1 input; radio @inputs =3D (\@inputRadio); $return =3D"
\n"; $return .=3D "rad= iovalue\n"; $return .=3D "
"; if ($return eq mkformnotable('actionurl', @inputs)) { print "ok 19\n"; } else { print "not ok 19\n"; } # 1 input; text @inputs =3D (\@inputText); $return =3D "
\n"; $return .=3D "\n"; $return .=3D "
"; if ($return eq mkformnotable('actionurl', @inputs)) { print "ok 20\n"; } else { print "not ok 20\n"; } # 1 input; textarea @inputs =3D (\@inputTextarea); $return =3D "
\n"; $return .=3D "\n"; $return .=3D "
"; if ($return eq mkformnotable('actionurl', @inputs)) { print "ok 21\n"; } else { print "not ok 21\n"; } # 1 input; submit @inputs =3D (\@inputSubmit); $return =3D "
\n"; $return .=3D "= \n"; $return .=3D "
"; if ($return eq mkformnotable('actionurl', @inputs)) { print "ok 22\n"; } else { print "not ok 22\n"; } # 1 input; reset @inputs =3D (\@inputReset); $return =3D "
\n"; $return .=3D "\n"; $return .=3D "
"; if ($return eq mkformnotable('actionurl', @inputs)) { print "ok 23\n"; } else { print "not ok 23\n"; } # 2 inputs; hidden and submit @inputs =3D (\@inputHidden, \@inputSubmit); $return =3D "
\n"; $return .=3D "= \n"; $return .=3D "= \n"; $return .=3D "
"; if ($return eq mkformnotable('actionurl', @inputs)) { print "ok 24\n"; } else { print "not ok 24\n"; } # 3 inputs; text, submit, and reset @inputs =3D (\@inputText, \@inputSubmit, \@inputReset); $return =3D "
\n"; $return .=3D "\n"; $return .=3D "= \n"; $return .=3D "\n"; $return .=3D "
"; if ($return eq mkformnotable('actionurl', @inputs)) { print "ok 25\n"; } else { print "not ok 25\n"; } --===============3096324290821885821==--