File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -1033,7 +1033,7 @@ mod tests {
1033
1033
let entities = basic_entities ( ) ;
1034
1034
let eval = Evaluator :: new ( request, & entities, & exts) ;
1035
1035
1036
- // Requires at least one argument.
1036
+ // Requires exactly two arguments
1037
1037
assert_ipaddr_wrong_num_args_err (
1038
1038
eval. interpret_inline_policy ( & Expr :: call_extension_fn (
1039
1039
Name :: parse_unqualified_name ( "isInRange" ) . expect ( "should be a valid identifier" ) ,
@@ -1046,6 +1046,15 @@ mod tests {
1046
1046
) ) ,
1047
1047
"isInRange" ,
1048
1048
) ;
1049
+ assert_ipaddr_wrong_num_args_err (
1050
+ eval. interpret_inline_policy ( & Expr :: call_extension_fn (
1051
+ Name :: parse_unqualified_name ( "isInRange" ) . expect ( "should be a valid identifier" ) ,
1052
+ vec ! [
1053
+ ip( "192.168.1.100" ) ,
1054
+ ] ,
1055
+ ) ) ,
1056
+ "isInRange" ,
1057
+ ) ;
1049
1058
}
1050
1059
1051
1060
#[ test]
Original file line number Diff line number Diff line change @@ -98,8 +98,8 @@ fn ip_extension_typecheck_fails() {
98
98
) ;
99
99
}
100
100
101
- #[ cfg( not( feature = "variadic-is-in-range" ) ) ]
102
101
#[ test]
102
+ #[ cfg( not( feature = "variadic-is-in-range" ) ) ]
103
103
fn ip_extension_not_variadic ( ) {
104
104
let src = "ip(\" 127.0.0.1\" ).isInRange(ip(\" 192.168.0.1/24\" ), ip(\" 192.167.0.1/24\" ), ip(\" 192.167.0.3/24\" ))" ;
105
105
let expr = Expr :: from_str ( src) . expect ( "parsing should succeed" ) ;
@@ -111,8 +111,8 @@ fn ip_extension_not_variadic() {
111
111
) ;
112
112
}
113
113
114
- #[ cfg( feature = "variadic-is-in-range" ) ]
115
114
#[ test]
115
+ #[ cfg( feature = "variadic-is-in-range" ) ]
116
116
fn ip_extension_variadic ( ) {
117
117
use crate :: ast:: Name ;
118
118
let ipaddr_name = Name :: parse_unqualified_name ( "ipaddr" ) . expect ( "should be a valid identifier" ) ;
You can’t perform that action at this time.
0 commit comments