test_fail
}
-if (!("%{Tmp-String-0[1]}" == "0x01\0010x07\0070x0A\n0x0D\r\"\"0xb0\260°")) {
+if (!(&Tmp-String-0[1] == "0x01\0010x07\0070x0A\n0x0D\r\"\"0xb0\260°")) {
test_fail
}
# This seems weird... double escapes for most things, but single escapes
# for the quotation marks.
#
-if (!("%{Tmp-String-2[1]}" == "0x01\0010x07\0070x0A\n0x0D\r''0xb0\260°")) {
+if (!(&Tmp-String-2[1] == "0x01\0010x07\0070x0A\n0x0D\r''0xb0\260°")) {
test_fail
}
}
# uncompiled - expansion - insensitive
-if ("%{Calling-Station-Id}" !~ /:roamyroam%{Tmp-String-0}$/i) {
+if (&Calling-Station-Id !~ /:roamyroam%{Tmp-String-0}$/i) {
test_fail
}
}
# compiled - expansion - insensitive
-if ("%{Calling-Station-Id}" !~ /:roamyroam$/i) {
+if (&Calling-Station-Id !~ /:roamyroam$/i) {
test_fail
}
&control.Tmp-String-0 ^= 'field3'
}
-if (!("%{control.Tmp-String-0[0]}" == 'success')) {
+if (!(&control.Tmp-String-0[0] == 'success')) {
test_fail
}
-if (!("%{control.Tmp-String-0[1]}" == "fail")) {
+if (!(&control.Tmp-String-0[1] == "fail")) {
test_fail
}
-if (!("%{control.Tmp-String-0[#]}" == 2)) {
+if (!(%{control.Tmp-String-0[#]} == 2)) {
test_fail
}
# Unencoded Password.Cleartext in password with header
#
&control := {
- &Password.With-Header = "%{User-Password}"
+ &Password.With-Header = &User-Password
}
pap.authorize
}
}
-if (!("%{control.Tmp-Integer-0[#]}" == 4)) {
+if (!(%{control.Tmp-Integer-0[#]} == 4)) {
test_fail
}
}
}
-if (!(&Tmp-Integer-0 == "%{Tmp-Integer-1[#]}")) {
+if (!(&Tmp-Integer-0 == %{Tmp-Integer-1[#]})) {
test_fail
}
# Tmp-Octets-1 doesn't exist, so Tmp-Octets-0 shouldn't be created
#
update request {
- &Tmp-Octets-0 := "%{Tmp-Octets-1}"
+ &Tmp-Octets-0 := &Tmp-Octets-1
}
-if (&Tmp-Integer-0) {
+if (&Tmp-Octets-0) {
test_fail
}
#
-# NULL valued strings get converted to empty length strings
+# Strings which quote NULL expansions still result in zero-length strings.
#
-# @fixme - EDIT - the new method is to simply omit the assignment
#
update request {
&Tmp-String-0 := "%{Reply-Message}"
}
# The prepended value should be first followd by the other two
-if (!(("%{Tmp-String-0[0]}" == 'boink')) || (!("%{Tmp-String-0[1]}" == 'foo')) || (!(%{Tmp-String-0[2]} == 'baz'))) {
+if (!((&Tmp-String-0[0] == 'boink')) || (!(&Tmp-String-0[1] == 'foo')) || (!(%{Tmp-String-0[2]} == 'baz'))) {
test_fail
}
-if (!("%{Tmp-String-0[#]}" == 3)) {
+if (!(%{Tmp-String-0[#]} == 3)) {
test_fail
}
}
# The attributes should now be "wibble", "foo", "baz", "boink", "foo", "baz"
-if (!(("%{Tmp-String-0[0]}" == 'wibble')) || (!("%{Tmp-String-0[1]}" == 'foo')) || (!(%{Tmp-String-0[2]} == 'baz')) || (!("%{Tmp-String-0[3]}" == 'boink')) || (!("%{Tmp-String-0[4]}" == 'foo')) || (!("%{Tmp-String-0[5]}" == 'baz'))) {
+if (!((&Tmp-String-0[0] == 'wibble')) || (!(&Tmp-String-0[1] == 'foo')) || (!(%{Tmp-String-0[2]} == 'baz')) || (!(&Tmp-String-0[3] == 'boink')) || (!(&Tmp-String-0[4] == 'foo')) || (!(&Tmp-String-0[5] == 'baz'))) {
test_fail
}
-if (!("%{Tmp-String-0[#]}" == 6)) {
+if (!(%{Tmp-String-0[#]} == 6)) {
test_fail
}
}
# The control attributes should now be "wibble", "foo", "baz", "boink", "foo", "baz", "initial"
-if (!(("%{control.Tmp-String-0[0]}" == 'wibble')) || (!("%{control.Tmp-String-0[1]}" == 'foo')) || (!(%{control.Tmp-String-0[2]} == 'baz')) || (!("%{control.Tmp-String-0[3]}" == 'boink')) || (!("%{control.Tmp-String-0[4]}" == 'foo')) || (!("%{control.Tmp-String-0[5]}" == 'baz')) || (!("%{control.Tmp-String-0[6]}" == 'initial'))) {
+if (!((&control.Tmp-String-0[0] == 'wibble')) || (!(&control.Tmp-String-0[1] == 'foo')) || (!(&control.Tmp-String-0[2] == 'baz')) || (!(&control.Tmp-String-0[3] == 'boink')) || (!(&control.Tmp-String-0[4] == 'foo')) || (!(&control.Tmp-String-0[5] == 'baz')) || (!(&control.Tmp-String-0[6] == 'initial'))) {
test_fail
}
-if (!("%{control.Tmp-String-0[#]}" == 7)) {
+if (!(%{control.Tmp-String-0[#]} == 7)) {
test_fail
}
&control.Tmp-IP-Address-1 := 192.0.3.1
}
-if (!(("%{Tmp-IP-Address-0[0]}" == 192.0.2.1)) || (!("%{Tmp-IP-Address-0[1]}" == 192.0.2.2))) {
+if (!((&Tmp-IP-Address-0[0] == 192.0.2.1)) || (!(&Tmp-IP-Address-0[1] == 192.0.2.2))) {
test_fail
}
}
# There should be no Tmp-IP-Address attributes in the request list
-if (&Tmp-IP-Address-0 || (!("%{Tmp-IP-Address-0[1]}" == ''))) {
+if (&Tmp-IP-Address-0) {
test_fail
}
# But there should still be some in the control list
-if (!((&control.Tmp-IP-Address-0 == 192.0.2.1)) || (!("%{control.Tmp-IP-Address-0[1]}" == 192.0.2.3))) {
+if (!((&control.Tmp-IP-Address-0 == 192.0.2.1)) || (!(&control.Tmp-IP-Address-0[1] == 192.0.2.3))) {
test_fail
}
}
# Only the 1st, 2nd, 3rd and 5th Tmp-IP-Address attributes should still be in the list
-if (!(("%{Tmp-IP-Address-0[0]}" == '192.0.2.1')) ||
- (!("%{Tmp-IP-Address-0[1]}" == '192.0.2.2')) ||
- (!("%{Tmp-IP-Address-0[2]}" == '192.0.2.3')) ||
- (!("%{Tmp-IP-Address-0[3]}" == '192.0.2.4')) ||
- (!("%{Tmp-IP-Address-0[4]}" == ''))) {
+if (!((&Tmp-IP-Address-0[0] == 192.0.2.1)) ||
+ (!(&Tmp-IP-Address-0[1] == 192.0.2.2)) ||
+ (!(&Tmp-IP-Address-0[2] == 192.0.2.3)) ||
+ (!(&Tmp-IP-Address-0[3] == 192.0.2.4)) ||
+ (!(&Tmp-IP-Address-0[4] == ''))) {
test_fail
}
&control.Tmp-IP-Address-0 += 192.0.2.3
}
-if (!(("%{Tmp-IP-Address-0[0]}" == 192.0.2.1)) || \
- (!("%{Tmp-IP-Address-0[1]}" == 192.0.2.2)) || \
- (!("%{Tmp-IP-Address-0[2]}" == 192.0.2.3)) || \
- (!("%{Tmp-IP-Address-0[3]}" == 192.0.2.4))) {
+if (!((&Tmp-IP-Address-0[0] == 192.0.2.1)) || \
+ (!(&Tmp-IP-Address-0[1] == 192.0.2.2)) || \
+ (!(&Tmp-IP-Address-0[2] == 192.0.2.3)) || \
+ (!(&Tmp-IP-Address-0[3] == 192.0.2.4))) {
test_fail
}
}
# Only the 2nd, 3rd and 4th Tmp-IP-Address attributes should still be in the list
-if (!(("%{Tmp-IP-Address-0[0]}" == '192.0.2.2')) || \
- (!("%{Tmp-IP-Address-0[1]}" == '192.0.2.3')) || \
- (!("%{Tmp-IP-Address-0[2]}" == '192.0.2.4')) || \
+if (!((&Tmp-IP-Address-0[0] == 192.0.2.2)) || \
+ (!(&Tmp-IP-Address-0[1] == 192.0.2.3)) || \
+ (!(&Tmp-IP-Address-0[2] == 192.0.2.4)) || \
(!("%{Tmp-IP-Address-0[3]}" == ''))) {
test_fail
}
}
# Only the 1st, and 3rd Tmp-IP-Address attributes should still be in the list
-if (!(("%{Tmp-IP-Address-0[0]}" == '192.0.2.2')) || \
- (!("%{Tmp-IP-Address-0[1]}" == '192.0.2.4')) || \
+if (!((&Tmp-IP-Address-0[0] == 192.0.2.2)) || \
+ (!(&Tmp-IP-Address-0[1] == 192.0.2.4)) || \
(!("%{Tmp-IP-Address-0[2]}" == ''))) {
test_fail
}
}
# Only the 1st, and 3rd Tmp-IP-Address attributes should still be in the list
-if (!(("%{Tmp-IP-Address-0[0]}" == '192.0.2.2')) || \
- (!("%{Tmp-IP-Address-0[1]}" == '192.0.2.4')) || \
+if (!((&Tmp-IP-Address-0[0] == 192.0.2.2)) || \
+ (!(&Tmp-IP-Address-0[1] == 192.0.2.4)) || \
(!("%{Tmp-IP-Address-0[2]}" == ''))) {
test_fail
}
}
# Only the 1st, and 3rd Tmp-IP-Address attributes should still be in the list
-if (!(("%{Tmp-IP-Address-0[0]}" == '192.0.2.2')) || \
+if (!((&Tmp-IP-Address-0[0] == 192.0.2.2)) || \
(!("%{Tmp-IP-Address-0[1]}" == ''))) {
test_fail
}
}
# But there should still be some in the control list
-if (!(("%{control.Tmp-IP-Address-0[0]}" == 192.0.2.1)) || (!("%{control.Tmp-IP-Address-0[1]}" == 192.0.2.3))) {
+if (!((&control.Tmp-IP-Address-0[0] == 192.0.2.1)) || (!(&control.Tmp-IP-Address-0[1] == 192.0.2.3))) {
test_fail
}
&Tmp-IP-Address-0 = 192.0.2.1
&Tmp-IP-Address-0 = 192.0.2.2
}
-if (!("%{Tmp-IP-Address-0[#]}" == 2)) {
+if (!(%{Tmp-IP-Address-0[#]} == 2)) {
test_fail
}
-if (!((&Tmp-IP-Address-0[0] == 192.0.2.1)) || (!("%{Tmp-IP-Address-0[1]}" == 192.0.2.2))) {
+if (!((&Tmp-IP-Address-0[0] == 192.0.2.1)) || (!(&Tmp-IP-Address-0[1] == 192.0.2.2))) {
test_fail
}
# Try calling these xlats in mapping too, they may get optimised to VPTs which is a
# different code path.
&request += {
- &Tmp-IP-Address-1 = "%{Tmp-IP-Address-0[1]}"
- &Tmp-IP-Address-1 = "%{Tmp-IP-Address-0[0]}"
+ &Tmp-IP-Address-1 = &Tmp-IP-Address-0[1]
+ &Tmp-IP-Address-1 = &Tmp-IP-Address-0[0]
&Tmp-String-0 = "%(concat:%{Tmp-IP-Address-0[*]} ,)"
- &Tmp-Integer-0 = "%{Tmp-IP-Address-0[#]}"
+ &Tmp-Integer-0 = %{Tmp-IP-Address-0[#]}
}
if (!(&Tmp-String-0 == '192.0.2.1,192.0.2.2')) {
&Tmp-uint64-0 := "%(integer:%{Tmp-Octets-1})"
#
-# Disabled until xlats can return binary data
+# Handle octets as strings for now.
#
if (!("%{Tmp-Octets-1}" == "0x%{hex:%{Tmp-uint64-0}}")) {
test_fail
&Tmp-Octets-0 = 0x0706050403020100
}
-if (!("%{Tmp-Octets-0}" == '0x0001020304050607')) {
+if (!(&Tmp-Octets-0 == 0x0001020304050607)) {
test_fail
}
-if (!("%{Tmp-Octets-0[0]}" == '0x0001020304050607')) {
+if (!(&Tmp-Octets-0[0] == 0x0001020304050607)) {
test_fail
}
&Tmp-String-0 := %(soh:OS)
# OS version not set
-if (!("%{Tmp-String-0}" == "Windows unknown")) {
+if (!(&Tmp-String-0 == "Windows unknown")) {
test_fail
}
&Tmp-String-0 := %(soh:OS)
# Version and Release combination that does not exist
-if (!("%{Tmp-String-0}" == "Windows Other 6.5.6001 sp 1.0")) {
+if (!(&Tmp-String-0 == "Windows Other 6.5.6001 sp 1.0")) {
test_fail
}
&Tmp-String-0 := %(soh:OS)
# Version that does not exist
-if (!("%{Tmp-String-0}" == "Windows Other 8.0.6001 sp 1.0")) {
+if (!(&Tmp-String-0 == "Windows Other 8.0.6001 sp 1.0")) {
test_fail
}
# reference here should be to an unknown attribute,
# and the dereference should fail.
#
-if ("%{reply.WiMAX.Capability.Release}" == "foo") { # ERROR
+if (&reply.WiMAX.Capability.Release == "foo") { # ERROR
test_fail
}
else {