From d7fe4f77a0db335e5fb16e3dc76d52fc8bf9ebb1 Mon Sep 17 00:00:00 2001 From: pate Date: Thu, 25 Apr 2002 13:58:09 +0000 Subject: [PATCH] added fixEthnicity tests --- koha.t | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/koha.t b/koha.t index b0b7e925c0..a908d15ad0 100644 --- a/koha.t +++ b/koha.t @@ -1,9 +1,12 @@ -BEGIN { $| = 1; print "1..2\n"; } +BEGIN { $| = 1; print "1..6\n"; } END {print "not ok 1\n" unless $loaded;} use C4::Koha; $loaded = 1; print "ok 1\n"; +# +# test that &slashifyDate returns correct (non-US) date +# $date = "01/01/2002"; $newdate = &slashifyDate("2002-01-01"); @@ -12,3 +15,27 @@ if ($date eq $newdate) { } 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"; +}