]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
more remove alternation :-
authorAlan T. DeKok <aland@freeradius.org>
Mon, 9 Oct 2023 15:49:01 +0000 (11:49 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 9 Oct 2023 15:49:13 +0000 (11:49 -0400)
src/tests/keywords/xlat-alternation
src/tests/keywords/xlat-alternation-fail-then-func
src/tests/keywords/xlat-double-alternation
src/tests/keywords/xlat-inline
src/tests/modules/files/module.conf

index c11d5cc679886f5be59ef8279bbe0bb0cb7cbae1..d843c2ef1de5b3dcdd3c483a9db1554b2e6cd5fa 100644 (file)
@@ -8,7 +8,7 @@
 #
 #  First choice
 #
-&Tmp-String-2 := "%{%{Tmp-String-0}:-%{Tmp-String-1}}"
+&Tmp-String-2 := "%{&Tmp-String-0 || &Tmp-String-1}"
 if (!(&Tmp-String-2 == 'foo')) {
        test_fail
 }
@@ -17,7 +17,7 @@ if (!(&Tmp-String-2 == 'foo')) {
 #  Second choice
 #
 &request -= &Tmp-String-0[*]
-&Tmp-String-2 := "%{%{Tmp-String-0}:-%{Tmp-String-1}}"
+&Tmp-String-2 := "%{&Tmp-String-0 || &Tmp-String-1}"
 if (!(&Tmp-String-2 == 'bar')) {
        test_fail
 }
@@ -33,7 +33,7 @@ if (!(&Tmp-String-2 == 'bar foo')) {
 #
 #  Alternation is empty
 #
-&Tmp-String-2 := "%{%{Tmp-String-0}:-}"
+&Tmp-String-2 := "%{&Tmp-String-0 || ''}"
 if (!(&Tmp-String-2 == '')) {
        test_fail
 }
@@ -47,7 +47,7 @@ if (!(&Tmp-String-2 == '')) {
 #
 #  Both sides are failing, so the assignment returns a NULL string
 #
-&Tmp-String-2 := "%{%{Tmp-String-0}:-%{Tmp-String-1}}"
+&Tmp-String-2 := "%{&Tmp-String-0 || &Tmp-String-1}"
 if (!(&Tmp-String-2 == "")) {
        test_fail
 }
@@ -57,7 +57,7 @@ if (!(&Tmp-String-2 == "")) {
 #
 &request -= &Tmp-String-2[*]
 
-&Tmp-String-2 := %{%{Tmp-String-0}:-%{Tmp-String-1}}
+&Tmp-String-2 := %{&Tmp-String-0 || &Tmp-String-1}
 if (&Tmp-String-2) {
        test_fail
 }
index 9cb9215061552d9f65d1ccc91625c1e5088c596e..4729389a05af9c8815e61da0dfb94bb99746c2c1 100644 (file)
@@ -4,6 +4,6 @@
 &request -= &Tmp-String-0[*]
 &request -= &Tmp-String-1[*]
 
-&Tmp-String-2 := "%{%{Tmp-String-0[0]}:-%{Tmp-String-1[0]}}%(delay_10s:)"
+&Tmp-String-2 := "%{&Tmp-String-0[0] || &Tmp-String-1[0]}%(delay_10s:)"
 
 success
index 4f94291bf861640ecb123f12c4938ce28c85b67e..a883c9866d3a33df0694080f1222246cb2bc7da4 100644 (file)
@@ -1,5 +1,5 @@
 # Regression test for double consecutive alternations
-&Tmp-uint64-0 := "%{%{Acct-Input-Octets}:-2}%{%{Acct-Input-Gigawords}:-1}"
+&Tmp-uint64-0 := "%{&Acct-Input-Octets || "2"}%{&Acct-Input-Gigawords || "1"}"
 if (!(&Tmp-uint64-0 == 21)) {
        test_fail
 }
index c3d192eb9862a687a74f4b25766f85db44535e7d..7a3fdf22a6627b5db389134ad3a0350abfc35078 100644 (file)
@@ -15,8 +15,8 @@ if (!("%(debug:%{Tmp-Integer-0})" == "%{Tmp-Integer-0}")) {
 }
 
 # Check for 'splosions
-"%{%{control.Password.Cleartext}:-%{control.User-Name}}"
-"%{%{control.User-Name}:-%{control.Password.Cleartext}}"
+"%{&control.Password.Cleartext || &control.User-Name}"
+"%{&control.User-Name || &control.Password.Cleartext}"
 
 if (&control.Password.Cleartext =~ /(h)(e)(l)(l)(o)/) {
        "%{0}"
index 21a75fdaf221646582886ae9c4c7c189698b9f79..cfce833fe05e744bdad2fbaf0dc9ac2f35f7e681 100644 (file)
@@ -2,7 +2,7 @@ files {
        # The default key attribute to use for matches.  The content
        # of this attribute is used to match the "name" of the
        # entry.
-       #key = "%{%{Stripped-User-Name}:-%{User-Name}}"
+       #key = "%{&Stripped-User-Name || &User-Name}"
 
        #  The old "users" style file is now located here.
        filename = $ENV{MODULE_TEST_DIR}/authorize