From: Alan T. DeKok Date: Wed, 25 May 2022 14:22:10 +0000 (-0400) Subject: tests for unary not X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6fb6d283aa92ae7c8b8070a7c70c7a1617f78c43;p=thirdparty%2Ffreeradius-server.git tests for unary not --- diff --git a/src/lib/unlang/xlat_expr.c b/src/lib/unlang/xlat_expr.c index be6fc42d13e..588957079f8 100644 --- a/src/lib/unlang/xlat_expr.c +++ b/src/lib/unlang/xlat_expr.c @@ -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 }; diff --git a/src/tests/unit/xlat/purify.txt b/src/tests/unit/xlat/purify.txt index 51c79773cf1..f17346b0dec 100644 --- a/src/tests/unit/xlat/purify.txt +++ b/src/tests/unit/xlat/purify.txt @@ -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