From 8beda6cfca9575778581881a77483938ac4e9c5f Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Wed, 12 Jan 2011 07:34:22 +0100 Subject: [PATCH] Bug 5601 :: Add tests for bugfix MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Frédéric Demians Signed-off-by: Chris Cormack (cherry picked from commit 0d5029ec5b3b95a3e38b67aa1aa1be6196e19dfb) Signed-off-by: Chris Nighswonger --- t/SIP_Sip.t | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/t/SIP_Sip.t b/t/SIP_Sip.t index 50d1229964..879c9835d4 100755 --- a/t/SIP_Sip.t +++ b/t/SIP_Sip.t @@ -6,7 +6,7 @@ use strict; use warnings; -use Test::More tests => 1; +use Test::More tests => 4; BEGIN { use FindBin; @@ -14,3 +14,14 @@ BEGIN { use_ok('C4::SIP::Sip'); } +my $date_time = Sip::timestamp(); +like( $date_time, qr/^\d{8} \d{6}$/, 'Timestamp format no param'); + +my $t = time(); + +$date_time = Sip::timestamp($t); +like( $date_time, qr/^\d{8} \d{6}$/, 'Timestamp format secs'); + +$date_time = Sip::timestamp('2011-01-12'); +ok( $date_time eq '20110112 235900', 'Timestamp iso date string'); + -- 2.39.5