]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
make it work with the new edit sections
authorAlan T. DeKok <aland@freeradius.org>
Fri, 29 Jul 2022 13:11:19 +0000 (09:11 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 29 Jul 2022 13:11:19 +0000 (09:11 -0400)
and a "todo" because

&Tmp-String-1 = "%(concat:%{request[*]} ', ')"

ends up as a group:

"{bob, hello, ab c, de fg, 123}"

src/tests/keywords/concat

index ab22ed785d9f250712734f1b07f55558cd29e1d3..629d271cea013e4e8b0996579ed0704b92326c4d 100644 (file)
@@ -1,6 +1,8 @@
 #
 # PRE: if
 #
+
+# this fails, so the next edit is merged in and fails, too.
 &request -= &Packet-Type
 
 &request += {
 
 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
 }