From: Nick Porter Date: Tue, 29 Jul 2025 09:56:51 +0000 (+0100) Subject: Add map tests with nested LHS X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d14f2da4b98764515eb5959498f0d6432a410461;p=thirdparty%2Ffreeradius-server.git Add map tests with nested LHS --- diff --git a/src/tests/keywords/map-list b/src/tests/keywords/map-list index e11ae8a367..c8f5beaea8 100644 --- a/src/tests/keywords/map-list +++ b/src/tests/keywords/map-list @@ -24,4 +24,12 @@ if (result1 != 'baa') { test_fail } +map list %str.split('local main other', ' ') { + control.IP-Pool.Name := 1 +} + +if (control.IP-Pool.Name != 'main') { + test_fail +} + success diff --git a/src/tests/modules/sql/map.unlang b/src/tests/modules/sql/map.unlang index c10a8a8944..69f00ba314 100644 --- a/src/tests/modules/sql/map.unlang +++ b/src/tests/modules/sql/map.unlang @@ -319,4 +319,13 @@ if !(control.NAS-IP-Address == 10.11.12.13) { test_fail } +# Check using nested path on the LHS +map sql "SELECT * FROM radusergroup WHERE priority = 0" { + control.IP-Pool.Name := 'username' +} + +if (control.IP-Pool.Name != 'bob') { + test_fail +} + test_pass