]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
tests for unary not
authorAlan T. DeKok <aland@freeradius.org>
Wed, 25 May 2022 14:22:10 +0000 (10:22 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 25 May 2022 14:59:54 +0000 (10:59 -0400)
src/lib/unlang/xlat_expr.c
src/tests/unit/xlat/purify.txt

index be6fc42d13e27eb04fdcc12131b0f3f346af789c..588957079f88c118a1fb3073edacf0c107248ab4 100644 (file)
@@ -526,7 +526,7 @@ static xlat_action_t xlat_func_logical(TALLOC_CTX *ctx, UNUSED fr_dcursor_t *out
 
 
 static xlat_arg_parser_t const unary_not_xlat_args[] = {
-       { .required = true, .type = FR_TYPE_BOOL },
+       { .required = true, .single = true, .type = FR_TYPE_BOOL },
        XLAT_ARG_PARSER_TERMINATOR
 };
 
index 51c79773cf1db5b5b6a4f8cb32bb9baca6199811..f17346b0dec3660052245627a724d0569ce7bc0c 100644 (file)
@@ -93,11 +93,6 @@ match yes
 xlat_purify &Filter-Id
 match %{Filter-Id}
 
-#
-#  @todo - the real answer is commented out, because
-#  %{md5:foo} while we added code to run the MD5
-#  function, it isn't called, and... who knows.
-#
 xlat_purify %{md5:foo} + "bar"
 match 0xacbd18db4cc2f85cedef654fccc4a4d8626172
 
@@ -173,6 +168,17 @@ match (%{Service-Type} == 3)
 xlat_purify &Filter-Id == ("foo" + "bar")
 match (%{Filter-Id} == foobar)
 
+xlat_purify !&User-Name
+match !%{User-Name}
+
+xlat_purify (1 < 2)
+match yes
+
+xlat_purify !(1 < 2)
+match no
+
+xlat_purify !true
+match no
 
 count
-match 59
+match 67