diff options
Diffstat (limited to 't/storable-test.pl')
-rw-r--r-- | t/storable-test.pl | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/t/storable-test.pl b/t/storable-test.pl new file mode 100644 index 0000000..33deb6f --- /dev/null +++ b/t/storable-test.pl @@ -0,0 +1,27 @@ +use strict; +use warnings; +use Storable; + +if (@ARGV && $ARGV[0] eq "store") { + require URI; + require URI::URL; + my $a = { + u => new URI('http://search.cpan.org/'), + }; + print "# store\n"; + store [URI->new("http://search.cpan.org")], 'urls.sto'; +} else { + print "# retrieve\n"; + my $a = retrieve 'urls.sto'; + my $u = $a->[0]; + #use Data::Dumper; print Dumper($a); + + print "not " unless $u eq "http://search.cpan.org"; + print "ok 1\n"; + + print "not " unless $u->scheme eq "http"; + print "ok 2\n"; + + print "not " unless ref($u) eq "URI::http"; + print "ok 3\n"; +} |