]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Test use of local variable to reference index in map list
authorNick Porter <nick@portercomputing.co.uk>
Thu, 24 Jul 2025 13:57:33 +0000 (14:57 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Thu, 24 Jul 2025 13:57:33 +0000 (14:57 +0100)
src/tests/keywords/map-list

index 2b2be61ac804ca2cede427fc68ec2d69198ec328..e11ae8a367eea4a0c3af037581568796cc1749a0 100644 (file)
@@ -2,6 +2,7 @@ string result0
 string result1
 string result2
 string result3
+integer index
 
 map list %str.split('one two three', ' ') {
        result0 := 0
@@ -14,4 +15,13 @@ if ((result0 != 'one') || (result1 != 'two') || (result2 != 'three') || result3)
        test_fail
 }
 
+index := 1
+map list %str.split('foo baa baz', ' ') {
+       result1 := index
+}
+
+if (result1 != 'baa') {
+       test_fail
+}
+
 success