Browse Source

protocol matching new works and so do the tests for it

tags/0.0.0
Zane C. B-H 1 month ago
parent
commit
bece6d6f1c

+ 1
- 1
Net-Connection-Match/lib/Net/Connection/Match/Protos.pm View File

@@ -76,7 +76,7 @@ sub new{
76 76
 	};
77 77
 
78 78
 	# run some basic checks to make sure we have the minimum stuff required to work
79
-	if ( ! defined( $args{states} ) ){
79
+	if ( ! defined( $args{protos} ) ){
80 80
 		die ('No states key specified in the argument hash');
81 81
 	}
82 82
 	if ( ref( \$args{protos} ) eq 'ARRAY' ){

+ 5
- 5
Net-Connection-Match/t/Protos.t View File

@@ -46,7 +46,7 @@ my $returned=1;
46 46
 eval{
47 47
 	$returned=$checker->match;
48 48
 };
49
-ok( $returned eq '0', 'match undef check') or diag('match accepted undefined input');
49
+ok( $returned eq '0', 'proto undef check') or diag('match accepted undefined input');
50 50
 
51 51
 # make sure it will not accept a improper ref type
52 52
 $returned=1;
@@ -55,21 +55,21 @@ eval{
55 55
 };
56 56
 ok( $returned eq '0', 'match improper ref check') or diag('match accepted a ref other than Net::Connection');
57 57
 
58
-# Create a connection with a matching state and see if it matches
58
+# Create a connection with a matching protocol and see if it matches
59 59
 my $conn=Net::Connection->new( $connection_args );
60 60
 $returned=0;
61 61
 eval{
62 62
 	$returned=$checker->match( $conn );
63 63
 };
64
-ok( $returned eq '1', 'state match check') or diag('Failed to match a matching good state');
64
+ok( $returned eq '1', 'proto match check') or diag('Failed to match a matching good protocol');
65 65
 
66
-# Create a connection with a non-matching state and make sure it does not match
66
+# Create a connection with a non-matching protocol and make sure it does not match
67 67
 $connection_args->{proto}='udp4';
68 68
 $conn=Net::Connection->new( $connection_args );
69 69
 $returned=1;
70 70
 eval{
71 71
 	$returned=$checker->match( $conn );
72 72
 };
73
-ok( $returned eq '0', 'state non-match check') or diag('Matched a state that it should not of');
73
+ok( $returned eq '0', 'proto non-match check') or diag('Matched a protocol that it should not of');
74 74
 
75 75
 done_testing(7);

Loading…
Cancel
Save