diff options
| author | fukachan <fukachan> | 2001-07-08 14:02:01 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2001-07-08 14:02:01 +0000 |
| commit | 2109c770e7220271d445b2b8f6c3094a0c44532c (patch) | |
| tree | a3b41a9bf3683315a9f2c0d215ea5a2d341c92c6 | |
| parent | f23650184505401737a691dc920075fd24fbf11b (diff) | |
| download | fml8-2109c770e7220271d445b2b8f6c3094a0c44532c.tar.gz fml8-2109c770e7220271d445b2b8f6c3094a0c44532c.tar.bz2 fml8-2109c770e7220271d445b2b8f6c3094a0c44532c.zip | |
add unixtime converter test
| -rw-r--r-- | regress/base/Makefile | 6 | ||||
| -rwxr-xr-x | regress/base/date2unixtime.pl | 26 |
2 files changed, 32 insertions, 0 deletions
diff --git a/regress/base/Makefile b/regress/base/Makefile index 40dd49d5..4632e72d 100644 --- a/regress/base/Makefile +++ b/regress/base/Makefile @@ -1,3 +1,7 @@ +# +# $FML$ +# + PERL = perl -I ../../fml/lib -I ../../cpan/lib -I ../../img/lib test: @@ -7,6 +11,8 @@ test: @ $(PERL) ../base/lock.pl @ echo "* checksum test" @ $(PERL) ../base/md5.pl + @ echo "* FML::Date test" + @ $(PERL) ../base/date2unixtime.pl @ echo "* Mail::Message module IO test" @ sh ../base/multipart_io.sh @ sh ../base/multipart_maker.sh diff --git a/regress/base/date2unixtime.pl b/regress/base/date2unixtime.pl new file mode 100755 index 00000000..23007b6a --- /dev/null +++ b/regress/base/date2unixtime.pl @@ -0,0 +1,26 @@ +#!/usr/bin/env perl +# +# $FML$ +# + +use FML::Date; + +require 'ctime.pl'; + +my $t = time; +my $date = ctime( $t ); + +chop $date; + +my $tx = FML::Date::date_to_unixtime( $date ), "\t"; + +print "* date -> unixtime: $t => $date => $tx\n"; + +if ($t == $tx) { + print "ok\n"; +} +else { + print "fail\n"; +} + +exit 0; |
