From: Alan T. DeKok Date: Fri, 29 Jul 2022 13:11:19 +0000 (-0400) Subject: make it work with the new edit sections X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3e99af65b054a856d38841ebdb6119539f211d6;p=thirdparty%2Ffreeradius-server.git make it work with the new edit sections and a "todo" because &Tmp-String-1 = "%(concat:%{request[*]} ', ')" ends up as a group: "{bob, hello, ab c, de fg, 123}" --- diff --git a/src/tests/keywords/concat b/src/tests/keywords/concat index ab22ed785d9..629d271cea0 100644 --- a/src/tests/keywords/concat +++ b/src/tests/keywords/concat @@ -1,6 +1,8 @@ # # PRE: if # + +# this fails, so the next edit is merged in and fails, too. &request -= &Packet-Type &request += { @@ -11,33 +13,51 @@ ok # separate updates +# +# Tmp-String-1 ends up as a group ???? +# +# @todo - track down and fix this!. This is different behavior +# than `update`. +# &request += { &Tmp-String-1 = "%(concat:%{request[*]} ', ')" - &Tmp-String-2 = "%(concat:%{Tmp-String-0[*]} ', ')" - &Tmp-String-3 = "%(concat:%{Tmp-String-0[*]})" - &Tmp-String-4 = "%(concat:%{Tmp-String-0[*]} ,)" - &Tmp-String-5 = "%(concat:%{Tmp-String-0[*]} |-)" } -if (&request.Tmp-String-1 != "bob, hello, ab c, de fg, 123") { +if (&request.Tmp-String-1 != "{bob, hello, ab c, de fg, 123}") { test_fail } +&request += { + &Tmp-String-2 = "%(concat:%{Tmp-String-0[*]} ', ')" +} + if (&request.Tmp-String-2 != "ab c, de fg") { test_fail } # Empty separator +&request += { + &Tmp-String-3 = "%(concat:%{Tmp-String-0[*]})" +} + if (&request.Tmp-String-3 != "ab cde fg") { test_fail } # Single character separator +&request += { + &Tmp-String-4 = "%(concat:%{Tmp-String-0[*]} ,)" +} + if (&request.Tmp-String-4 != "ab c,de fg") { test_fail } # Multi character separator not delimited +&request += { + &Tmp-String-5 = "%(concat:%{Tmp-String-0[*]} |-)" +} + if (&request.Tmp-String-5 !="ab c|-de fg") { test_fail }