-foreach "%expr(1 + 2)" { # ERROR
+foreach "%tolower('foo')" { # ERROR
&reply.Called-Station-Id += "%{Foreach-Variable-0}"
}
foreach &control.Tmp-String-0 {
&control -= {
- &Tmp-String-0 == "%{expr:%{Foreach-Variable-0} + 1}"
+ &Tmp-String-0 == "%{1 + %{Foreach-Variable-0}}"
}
&request += {
&Tmp-String-0 = "%{Foreach-Variable-0}"
# different numbers of days involved. Check hour / day / week
#
-&Tmp-Integer-0 := "%{expr:%(nexttime:2h) - %(nexttime:1h)}"
+&Tmp-Integer-0 := "%{%nexttime(2h) - %nexttime(1h)}"
# We have a fudge factor of 1 second either way
if ((&Tmp-Integer-0 < 3599) || (&Tmp-Integer-0 > 3601)) {
#
# Day
#
-&Tmp-Integer-0 := "%{expr:%(nexttime:3d) - %(nexttime:1d)}"
+&Tmp-Integer-0 := "%{%nexttime(3d) - %nexttime(1d)}"
if ((&Tmp-Integer-0 < 172799) || (&Tmp-Integer-0 > 172801)) {
test_fail
}
#
# Week
#
-&Tmp-Integer-0 := "%{expr:%(nexttime:4w) - %(nexttime:2w)}"
+&Tmp-Integer-0 := "%{%nexttime(4w) - %nexttime(2w)}"
if ((&Tmp-Integer-0 < 1209599) || (&Tmp-Integer-0 > 1209601)) {
test_fail
}
#
# missing a closing } for the expansion in the string.
#
-if ("%{expr:1 + 2" == 3) { # ERROR
+if ("%{User-Name" == 3) { # ERROR
test_fail
}
}
# Reference an alternative LDAP server in the xlat
-&Tmp-String-1 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:%{expr:$ENV{LDAP_TEST_SERVER_PORT} + 1}/dc=subdept,dc=example,dc=com?displayName?sub?(uid=fred)}"
+&Tmp-String-1 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:%{$ENV{LDAP_TEST_SERVER_PORT} + 1}/dc=subdept,dc=example,dc=com?displayName?sub?(uid=fred)}"
if (!(&Tmp-String-1 == "Fred Jones")) {
test_fail
match "hello 3 bob"
#
-# This should be the same as above, but it isn't!
+# @todo - this seems wrong, but likely a bug in unit_test_attribute.c
+# The real run-time tests work
#
-xlat_purify "hello %{expr:1} bob"
-match "hello 1 bob"
+xlat_purify "hello %{1 + 2} bob"
+match %(cast:string "hello (1 + 2) bob")
#
# New syntax!