]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Test handling of FR_TYPE_NULL in map list
authorNick Porter <nick@portercomputing.co.uk>
Thu, 24 Jul 2025 11:16:08 +0000 (12:16 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Thu, 24 Jul 2025 12:32:16 +0000 (13:32 +0100)
src/tests/modules/redis/xlat.unlang

index 70ca7cbfe0d8bf4a5775ac92d64e4fe935c8545c..15febb85dd1b0f4dce263c7d344089a17f2c3b1e 100644 (file)
@@ -2,6 +2,9 @@
 #  Call redis commands as xlat
 #
 integer dummy_number
+string result0
+string result1
+string result3
 $INCLUDE cluster_reset.inc
 
 %redis('SET', 'value1', 100)
@@ -28,4 +31,16 @@ if ((control.Tmp-String-0[0] != 'fooval') || (control.Tmp-String-0[1] != '300')
        test_fail
 }
 
+# Use map list to process the result of an xlat, where nil results will be returned.
+map list %redis('HMGET', 'hash1', 'foo', 'boink', 'baz') {
+       result0 := 0
+       result1 := 1
+       dummy_number := 2
+       result3 := 3
+}
+
+if ((result0 != 'fooval') || result1 || (dummy_number != 300) || result3) {
+       test_fail
+}
+
 test_pass