LP#1516757: add Perl test case
authorGalen Charlton <gmc@esilibrary.com>
Wed, 2 Mar 2016 20:38:52 +0000 (15:38 -0500)
committerGalen Charlton <gmc@esilibrary.com>
Wed, 2 Mar 2016 20:39:53 +0000 (15:39 -0500)
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/src/perlmods/t/12-OpenILS-SIP.t

index cf93a0c..454a21a 100644 (file)
@@ -1,6 +1,8 @@
-#!perl -T
+#!perl
+# note that taint mode is explicitly off; see
+# https://rt.cpan.org/Public/Bug/Display.html?id=94520 for why
 
-use Test::More tests => 8;
+use Test::More tests => 9;
 
 BEGIN {
        use_ok( 'OpenILS::SIP' );
@@ -13,3 +15,8 @@ use_ok( 'OpenILS::SIP::Transaction' );
 use_ok( 'OpenILS::SIP::Transaction::Checkin' );
 use_ok( 'OpenILS::SIP::Transaction::Checkout' );
 use_ok( 'OpenILS::SIP::Transaction::Renew' );
+
+$ENV{TZ} = 'America/New_York'; # chosen to exercise the LP#1516757 bug
+my $dob = '1960-12-31';
+my $dob_formatted = OpenILS::SIP->format_date($dob, 'dob');
+is($dob_formatted, '19601231', 'LP#1516757: ensure dates of birth do not get offset');