From: Alan T. DeKok Date: Tue, 30 Aug 2022 19:03:22 +0000 (-0400) Subject: test index assignments X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cfe4bea2a23da7f6b0e4b3022eb1793f62561a6e;p=thirdparty%2Ffreeradius-server.git test index assignments --- diff --git a/src/tests/keywords/attr-index b/src/tests/keywords/attr-index new file mode 100644 index 00000000000..31c9ce2bf20 --- /dev/null +++ b/src/tests/keywords/attr-index @@ -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