From: Alan T. DeKok Date: Tue, 3 Oct 2023 12:27:19 +0000 (-0400) Subject: more conversion to new function format X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f6236fb7e26433c79ff7d0044f14f06e59c0d62;p=thirdparty%2Ffreeradius-server.git more conversion to new function format --- diff --git a/src/tests/keywords/expr-double b/src/tests/keywords/expr-double index e87788cf25a..ecd17a5e2ae 100644 --- a/src/tests/keywords/expr-double +++ b/src/tests/keywords/expr-double @@ -1,5 +1,5 @@ # # We only care if this crashes or not. # -&Filter-Id := "%{eval:1 + 1} %{tolower: 1}" +&Filter-Id := "%{1 + 1} %tolower(1)" success diff --git a/src/tests/keywords/hex b/src/tests/keywords/hex index 406540985e7..316ab3ae01f 100644 --- a/src/tests/keywords/hex +++ b/src/tests/keywords/hex @@ -17,14 +17,14 @@ ok # break up edit sections &Tmp-String-1 := { - "%{hex:%{Tmp-String-0}}" - "%{hex:%{Tmp-Octets-0}}" - "%{hex:%{Tmp-IP-Address-0}}" - "%{hex:%{Tmp-Integer-0}}" - "%{hex:%{Tmp-Cast-Ifid}}" - "%{hex:%{Tmp-Cast-IPv6Addr}}" - "%{hex:%{Tmp-Cast-IPv6Prefix}}" - "%{hex:%{Tmp-Cast-Byte}}" + %hex(%{Tmp-String-0}) + %hex(%{Tmp-Octets-0}) + %hex(%{Tmp-IP-Address-0}) + %hex(%{Tmp-Integer-0}) + %hex(%{Tmp-Cast-Ifid}) + %hex(%{Tmp-Cast-IPv6Addr}) + %hex(%{Tmp-Cast-IPv6Prefix}) + %hex(%{Tmp-Cast-Byte}) } # String @@ -68,10 +68,10 @@ if (!(&Tmp-String-1[7] == '3a')) { } &Tmp-String-1 := { - "%{hex:%{Tmp-Cast-Short}}" - "%{hex:%{Tmp-Cast-Ether}}" - "%{hex:%{Tmp-Cast-Integer64}}" - "%{hex:%{Tmp-Cast-IPv4Prefix}}" + %hex(%{Tmp-Cast-Short}) + %hex(%{Tmp-Cast-Ether}) + %hex(%{Tmp-Cast-Integer64}) + %hex(%{Tmp-Cast-IPv4Prefix}) } # short diff --git a/src/tests/keywords/tolower b/src/tests/keywords/tolower index 0cae57d2755..d7bb22732fe 100644 --- a/src/tests/keywords/tolower +++ b/src/tests/keywords/tolower @@ -2,13 +2,13 @@ # PRE: if # &Tmp-String-0 := "AbCdE" -&Tmp-String-0 := "%{tolower:%{Tmp-String-0}}" -&Tmp-String-1 := "%{tolower:AAbbCCdd}" +&Tmp-String-0 := %tolower(%{Tmp-String-0}) +&Tmp-String-1 := %tolower(AAbbCCdd) # # Doesn't exist # -&Tmp-String-2 := "%{tolower:%{Tmp-String-9}}" +&Tmp-String-2 := "%tolower(%{Tmp-String-9})" if (!(&Tmp-String-0 == "abcde")) { diff --git a/src/tests/keywords/toupper b/src/tests/keywords/toupper index 5dfbc992f37..5bc1bea1d17 100644 --- a/src/tests/keywords/toupper +++ b/src/tests/keywords/toupper @@ -3,9 +3,9 @@ # &Tmp-String-0 := "AbCdE" -&Tmp-String-0 := "%{toupper:%{Tmp-String-0}}" -&Tmp-String-1 := "%{toupper:AAbbCCdd}" -&Tmp-String-2 := "%{toupper:%{Tmp-String-9}}" +&Tmp-String-0 := %toupper(%{Tmp-String-0}) +&Tmp-String-1 := %toupper(AAbbCCdd) +&Tmp-String-2 := "%toupper(%{Tmp-String-9})" if (!(&Tmp-String-0 == "ABCDE")) { test_fail diff --git a/src/tests/keywords/xlat-escape b/src/tests/keywords/xlat-escape index 8a511810416..8a5a81c0cfd 100644 --- a/src/tests/keywords/xlat-escape +++ b/src/tests/keywords/xlat-escape @@ -1,5 +1,5 @@ # -# PRE: update +# PRE: if # # # Verify escaping of % @@ -8,7 +8,7 @@ if !("\%{ FOO}" == '%{ FOO}') { test_fail } -if !("%{tolower:\%{ FOO}" == '%{ foo') { +if !(%tolower(\%{FOO}) == '%{foo}') { test_fail } diff --git a/src/tests/keywords/xlat-string b/src/tests/keywords/xlat-string index a8d861eaec5..78fd5a0a07b 100644 --- a/src/tests/keywords/xlat-string +++ b/src/tests/keywords/xlat-string @@ -11,10 +11,10 @@ } &request += { - &Tmp-String-0 = "%{string:%{Tmp-Octets-0}}" - &Tmp-String-1 = "%{string:%{Tmp-Octets-1}}" - &Tmp-String-2 = "%{string:%{Tmp-Octets-2}}" - &Tmp-String-3 = "%{string:%{Tmp-Octets-3}}" + &Tmp-String-0 = %string(%{Tmp-Octets-0}) + &Tmp-String-1 = %string(%{Tmp-Octets-1}) + &Tmp-String-2 = %string(%{Tmp-Octets-2}) + &Tmp-String-3 = %string(%{Tmp-Octets-3}) } if (!(&Tmp-String-0 == "\\\\")) { @@ -24,15 +24,22 @@ if (!(&Tmp-String-0 == "\\\\")) { # # Test interpolation between string expansions and strings # -if (!("%{string:%{Tmp-Octets-4}}%{string:%{Tmp-Octets-5}}" == "test1test2")) { +if (!("%string(%{Tmp-Octets-4})%string(%{Tmp-Octets-5})" == "test1test2")) { test_fail } -if (!("test0%{string:%{Tmp-Octets-4}}%{string:%{Tmp-Octets-5}}" == "test0test1test2")) { +# +# We don't need %string(...) either. +# +if !("%{(string) &Tmp-Octets-4}%{(string) &Tmp-Octets-5}" == "test1test2") { + test_fail +} + +if (!("test0%string(%{Tmp-Octets-4})%string(%{Tmp-Octets-5})" == "test0test1test2")) { test_fail } -if (!("%{string:%{Tmp-Octets-4}}%{string:%{Tmp-Octets-5}}test3" == "test1test2test3")) { +if (!("%string(%{Tmp-Octets-4})%string(%{Tmp-Octets-5})test3" == "test1test2test3")) { test_fail }