]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
test index assignments
authorAlan T. DeKok <aland@freeradius.org>
Tue, 30 Aug 2022 19:03:22 +0000 (15:03 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 30 Aug 2022 19:03:22 +0000 (15:03 -0400)
src/tests/keywords/attr-index [new file with mode: 0644]

diff --git a/src/tests/keywords/attr-index b/src/tests/keywords/attr-index
new file mode 100644 (file)
index 0000000..31c9ce2
--- /dev/null
@@ -0,0 +1,36 @@
+&request += {
+       &Tmp-String-0 = "foo"
+       &Tmp-String-0 = "bar"
+       &Tmp-String-0 = "baz"
+}
+
+&Tmp-String-0[1] := "yellow"
+
+if ("%{Tmp-String-0[*]}" != "fooyellowbaz") {
+       test_fail
+}
+
+&Tmp-String-0[2] += "red"
+
+if ("%{Tmp-String-0[*]}" != "fooyellowbazred") {
+       test_fail
+}
+
+&Tmp-String-0[2] -= "red"
+
+if ("%{Tmp-String-0[*]}" != "fooyellowbaz") {
+       test_fail
+}
+
+&Tmp-String-0[0] := "oof"
+if ("%{Tmp-String-0[*]}" != "oofyellowbaz") {
+       test_fail
+}
+
+&Tmp-String-0[1] := "bar"
+if ("%{Tmp-String-0[*]}" != "oofbarbaz") {
+       test_fail
+}
+
+
+success