1# Before `make install' is performed this script should be runnable with 2# `make test'. After `make install' it should work as `perl Convert-NLS_DATE_FORMAT.t' 3 4######################### 5 6use Test::More; 7use Convert::NLS_DATE_FORMAT; 8 9our %tests = ( 10 'YYYY-MM-DD HH24:MI:SS TZR' => '%Y-%m-%d %H:%M:%S %Z', 11 'YYYY-MM-DD HH24:MI:SS TZHTZM' => '%Y-%m-%d %H:%M:%S %z', 12 'YYYY-MM-DD HH24:MI:SS' => '%Y-%m-%d %H:%M:%S', 13 'YYYY-MM-DD HH:MI:SS pm' => '%Y-%m-%d %I:%M:%S %P', 14 'YYYY-MM-DD HH:MI:SS PM' => '%Y-%m-%d %I:%M:%S %p', 15 'DD Mon YYYY' => '%d %b %Y', 16 'DD-Mon-RR' => '%d-%b-%y', # default NLS_DATE_FORMAT 17 'DD-Mon-RR HH.MI.SSXFF PM' => '%d-%b-%y %I.%M.%S.%6N %p', # default NLS_TIMESTAMP_FORMAT 18 'DD-Mon-RR HH.MI.SSXFF PM TZR' => '%d-%b-%y %I.%M.%S.%6N %p %Z', # default NLS_TIMESTAMP_TZ_FORMAT 19 'Day, DD Month, YYYY' => '%A, %d %B, %Y', 20 'YYYY - Q' => '%Y - %{quarter}', 21); 22 23plan tests => scalar(keys %tests); 24 25######################### 26 27# Insert your test code below, the Test::More module is use()ed here so read 28# its man page ( perldoc Test::More ) for help writing this test script. 29 30while (my ($nls, $strf) = each %tests) { 31 is(Convert::NLS_DATE_FORMAT::posix2oracle($strf), $nls, $strf); 32} 33