set and get json correctly in redis for caching gearman
[APKPM.git] / t / ZTEMSAN.t
index a1f3f71..3f4f2b5 100755 (executable)
@@ -2,13 +2,22 @@
 use strict;
 use warnings;
 
-use Test::More tests => 2;
+use Test::More tests => 4;
 use Data::Dump qw(dump);
 
 use lib 'lib';
 
 use_ok 'H1::ZTEMSAN';
 
-ok my $hash = H1::ZTEMSAN->hash( '10.99.2.115', '0/15/0' ), 'new';
+my $ip = shift @ARGV || '10.99.2.115';
+my @ports = @ARGV;
+@ports = qw( 0/15/0 0/16/0 ) unless @ports;
+
+ok my $o = H1::ZTEMSAN->new( ip => $ip ), "new $ip";
+
+foreach my $port ( @ports ) {
+
+       ok my $hash = $o->hash( $port ), "port $port";
+       diag dump $hash;
+}
 
-diag dump $hash;