From: Alan T. DeKok Date: Wed, 9 Feb 2022 21:02:43 +0000 (-0500) Subject: add more xlat_expr run-time tests X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=33312dcf84fb507a8904bff23c8afa7414f02827;p=thirdparty%2Ffreeradius-server.git add more xlat_expr run-time tests --- diff --git a/src/tests/xlat/expr.txt b/src/tests/xlat/expr.txt index 60995b755c..b036027268 100644 --- a/src/tests/xlat/expr.txt +++ b/src/tests/xlat/expr.txt @@ -1,5 +1,32 @@ xlat_expr 1 && 2 match yes -#xlat_expr 1 < 2 -#match yes +xlat_expr 1 < 2 +match yes + +xlat_expr 1 + 2 +match 3 + +xlat_expr (ipv4prefix) 192.168.0.0/16 + 4 +match 192.168.0.4 + +# +# This crashes right now, because "foo" is marked up as needing xlat expansion. it doesn't, but +# the rest of the code tries to bootstrap it, and unit_test_module doesn't do thread +# instantiation of xlats. +# +# and if that's fixed, xlat_eval() needs to be fixed to handle this data type. +# +#xlat_expr "foo" +#match "foo" + +# This crashes, too. +# +#xlat_expr "foo" + "bar" +#match "foobar" + +xlat_expr 0xabcdef + 0x1234 +match 0xabcdef1234 + +xlat_expr 2 ^ 4 +match 6