From: Arran Cudbard-Bell Date: Wed, 8 Nov 2023 01:18:13 +0000 (-0600) Subject: Add test for using local attributes in eval X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7842e9d9b8dc6fee0e587ae86296e1913680e708;p=thirdparty%2Ffreeradius-server.git Add test for using local attributes in eval --- diff --git a/src/tests/keywords/xlat-eval b/src/tests/keywords/xlat-eval index 4510588f7c9..b2989638ce9 100644 --- a/src/tests/keywords/xlat-eval +++ b/src/tests/keywords/xlat-eval @@ -34,10 +34,32 @@ if (!(%eval("\%{Tmp-String-1[%{Tmp-Integer-0[2]}]}") == 'bar')) { } # -# Check yielding works +# Check yielding works (regression test?) # if ((time_delta)%reschedule() > 1s) { test_fail } +# +# Verify eval can find local attributes +# +group { + uint32 idx + string stackstr + + &idx := 1 + + if (!(%eval("\%{Tmp-String-1[%{idx}]}") == 'bar')) { + test_fail + } + + &stackstr := { 'foo' } + + &idx := 2 + + if (!(%eval("\%{stackstr}") == 'foo')) { + test_fail + } +} + success