test_fail
}
-if (&request.Reply-Message[0] != 'I am #literally a comment #') {
+if !(&request.Reply-Message[0] == 'I am #literally a comment #') {
test_fail
}
&Tmp-String-5 = "%(concat:%{Tmp-String-0[*]} |-)"
}
-if (&Tmp-String-5 !="ab c|-de fg") {
+if !(&Tmp-String-5 == "ab c|-de fg") {
test_fail
}
&Tmp-Date-0 := 1659985459
&Tmp-String-2 := "%(sqldate:%{Tmp-Date-0})"
-if (&Tmp-String-2 != '2022-08-08 19:04:19') {
+if !(&Tmp-String-2 == '2022-08-08 19:04:19') {
test_fail
}
test_fail
}
-if (&Module-Failure-Message != "Failed to parse time string \"201-32-22 17:25:00\" as format '\%Y-\%m-\%d \%H:\%M:\%S'") {
+if (!(&Module-Failure-Message == "Failed to parse time string \"201-32-22 17:25:00\" as format '\%Y-\%m-\%d \%H:\%M:\%S'")) {
test_fail
}
#
# The various edits above should have been reverted.
#
-if (&Tmp-Integer-0 != 4) {
+if !(&Tmp-Integer-0 == 4) {
test_fail
}
-if (&Tmp-Integer-1 != 5) {
+if !(&Tmp-Integer-1 == 5) {
test_fail
}
success
}
# And another slightly different codepath...
-if ("%{Tmp-String-0[*]}" != "i have scary embedded things\000 inside me0x01\0010x07\0070x0A\n0x0D\r\"\"0xb0\260°") {
+if !("%{Tmp-String-0[*]}" == "i have scary embedded things\000 inside me0x01\0010x07\0070x0A\n0x0D\r\"\"0xb0\260°") {
test_fail
}
if (!(%{expr: 1 + 2 + 3 + 4} == 10)) {
test_fail
}
-if (1 + 2 + 3 + 4 != 10) {
+if !(1 + 2 + 3 + 4 == 10) {
test_fail
}
if (!(%{expr: 1 + 2 * 3 + 4} == 11)) {
test_fail
}
-if (1 + 2 * 3 + 4 != 11) {
+if !(1 + 2 * 3 + 4 == 11) {
test_fail
}
if (!(%{expr: 1 + 2 * &Tmp-Integer-1 + 4} == 11)) {
test_fail
}
-if (1 + 2 * &Tmp-Integer-1 + 4 != 11) {
+if !(1 + 2 * &Tmp-Integer-1 + 4 == 11) {
test_fail
}
if (!(%{expr: 1 + 2 * (&Tmp-Integer-1 + 4)} == 15)) {
test_fail
}
-if (1 + 2 * (&Tmp-Integer-1 + 4) != 15) {
+if !(1 + 2 * (&Tmp-Integer-1 + 4) == 15) {
test_fail
}
if (!(%{expr: 1 + 2 * (&Tmp-Integer-1 + &Tmp-Integer-2)} == 15)) {
test_fail
}
-if (1 + 2 * (&Tmp-Integer-1 + &Tmp-Integer-2) != 15) {
+if !(1 + 2 * (&Tmp-Integer-1 + &Tmp-Integer-2) == 15) {
test_fail
}
if (!(%{expr: 1 & ~1} == 0)) {
test_fail
}
-if ((1 & ~1) != 0) { # needs an extra () to resolve ambiguities and warnings
+if !((1 & ~1) == 0) { # needs an extra () to resolve ambiguities and warnings
test_fail
}
if (!(%{expr: 1 & ~2} == 1)) {
test_fail
}
-if ((1 & ~2) != 1) { # needs an extra () to resolve ambiguities and warnings
+if !((1 & ~2) == 1) { # needs an extra () to resolve ambiguities and warnings
test_fail
}
if (!(%{expr: -1 * 2} == -2)) {
test_fail
}
-if (-1 * 2 != -2) {
+if !(-1 * 2 == -2) {
test_fail
}
if (!(%{expr: 11 % 2} == 1)) {
test_fail
}
-if (11 % 2 != 1) {
+if !(11 % 2 == 1) {
test_fail
}
if (!(%{expr: 2 - -1} == 3)) {
test_fail
}
-if (2 - -1 != 3) {
+if !(2 - -1 == 3) {
test_fail
}
if (!(%{expr: 1 << 2 | 1} == 5)) {
test_fail
}
-if (((1 << 2) | 1) != 5) { # needs extra () to resolve precedence
+if !(((1 << 2) | 1) == 5) { # needs extra () to resolve precedence
test_fail
}
if (!(%{expr: 6 + -(1 + 3)} == 2)) {
test_fail
}
-if (6 + -(1 + 3) != 2) {
+if !(6 + -(1 + 3) == 2) {
test_fail
}
if (!(%{expr: 6 * -&Tmp-Integer-2} == -24)) {
test_fail
}
-if (6 * -&Tmp-Integer-2 != -24) {
+if !(6 * -&Tmp-Integer-2 == -24) {
test_fail
}
# Now that we ignore whitespace (including \r\n) inside of a *bracketed* expression,
# we can magically have multiline "if" statements.
#
-if (1 + 2
- != 3) {
+if !(1 + 2
+ == 3) {
test_fail
}
success
test_fail
}
-if (&Tmp-Integer-0 + &Tmp-Integer-1 != 50) {
+if !(&Tmp-Integer-0 + &Tmp-Integer-1 == 50) {
test_fail
}
test
-if (&Module-Failure-Message[4] != 'test: RERROR error message') {
+if !(&Module-Failure-Message[4] == 'test: RERROR error message') {
test_fail
}
-if (&Module-Failure-Message[3] != 'test: RDEBUG error message') {
+if !(&Module-Failure-Message[3] == 'test: RDEBUG error message') {
test_fail
}
-if (&Module-Failure-Message[2] != 'test: RDEBUG2 error message') {
+if !(&Module-Failure-Message[2] == 'test: RDEBUG2 error message') {
test_fail
}
-if (&Module-Failure-Message[1] != 'test: RDEBUG3 error message') {
+if !(&Module-Failure-Message[1] == 'test: RDEBUG3 error message') {
test_fail
}
-if (&Module-Failure-Message[0] != 'test: RDEBUG4 error message') {
+if !(&Module-Failure-Message[0] == 'test: RDEBUG4 error message') {
test_fail
}
&Tmp-String-5 = "%(pairs:control.User-Name)"
}
-if (&Tmp-String-1 != "User-Name = \"bob\", User-Password = \"hello\", Tmp-String-0 = \"This is a string\", Tmp-String-0 = \"This is another one\", Tmp-Octets-0 = 0x000504030201, Tmp-Integer-0 = 7331") {
+if !(&Tmp-String-1 == "User-Name = \"bob\", User-Password = \"hello\", Tmp-String-0 = \"This is a string\", Tmp-String-0 = \"This is another one\", Tmp-Octets-0 = 0x000504030201, Tmp-Integer-0 = 7331") {
test_fail
}
-if (&Tmp-String-2 != "Tmp-String-0 = \"This is a string\"") {
+if !(&Tmp-String-2 == "Tmp-String-0 = \"This is a string\"") {
test_fail
}
-if (&Tmp-String-3 != "Tmp-String-0 = \"This is a string\", Tmp-String-0 = \"This is another one\"") {
+if !(&Tmp-String-3 == "Tmp-String-0 = \"This is a string\", Tmp-String-0 = \"This is another one\"") {
test_fail
}
-if (&Tmp-String-4 != "Password.Cleartext = \"hello\"") {
+if !(&Tmp-String-4 == "Password.Cleartext = \"hello\"") {
test_fail
}
test_fail
}
-if (&reply.Tmp-Group-0.Tmp-String-0 != 'hello from subrequest') {
+if !(&reply.Tmp-Group-0.Tmp-String-0 == 'hello from subrequest') {
test_fail
}
test_fail
}
-if (&reply.Tmp-Group-0.Tmp-Group-0.Tmp-String-0 != 'hello from subrequest') {
+if !(&reply.Tmp-Group-0.Tmp-Group-0.Tmp-String-0 == 'hello from subrequest') {
test_fail
}
&255 = 0x00
}
-if (&26.6139.1 != 0x00000013) {
+if !(&26.6139.1 == 0x00000013) {
test_fail
}
-if (&26.9.42 != 0x0001020304) {
+if !(&26.9.42 == 0x0001020304) {
test_fail
}
-if (&255 != 0x00) {
+if !(&255 == 0x00) {
test_fail
}
"%{Tmp-String-0}" := 'hello'
}
-if (&Tmp-String-1 != 'hello') {
+if !(&Tmp-String-1 == 'hello') {
test_fail
}
"Vendor-%{Tmp-Integer-0}-1" := 0x01020304
}
-if (&Vendor-66-1 != 0x01020304) {
+if !(&Vendor-66-1 == 0x01020304) {
test_fail
}
"Vendor-%{Tmp-Integer-0}-1" := 127.0.0.1
}
-if (&Vendor-Specific.FreeRADIUS.Proxied-To != 127.0.0.1) {
+if !(&Vendor-Specific.FreeRADIUS.Proxied-To == 127.0.0.1) {
test_fail
}
"%(attr_num:Tmp-String-1)" := 'hello2'
}
-if (&Tmp-String-1 != 'hello2') {
+if !(&Tmp-String-1 == 'hello2') {
test_fail
}
#
# Verify escaping of %
#
-if ("\%{ FOO}" != '%{ FOO}') {
+if !("\%{ FOO}" == '%{ FOO}') {
test_fail
}
-if ("%{tolower:\%{ FOO}" != '%{ foo') {
+if !("%{tolower:\%{ FOO}" == '%{ foo') {
test_fail
}
debug_all
-if (!("%{Tmp-String-1}" == "1=1,my_attr=2,my_attr=hello")) {
+if (!(&Tmp-String-1 == "1=1,my_attr=2,my_attr=hello")) {
test_fail
}
-if (!("%{Tmp-String-2}" == "")) {
+if (!(&Tmp-String-2 == "")) {
test_fail
}
-if (!("%{Tmp-String-3}" == "hello,goodbye,morning,night,1")) {
+if (!(&Tmp-String-3 == "hello,goodbye,morning,night,1")) {
test_fail
}
-if ("%{Tmp-String-4}" != 'Can\'t touch this') {
+if !(&Tmp-String-4 == 'Can\'t touch this') {
test_fail
}
-if ("%{Tmp-String-5}" != 'here, are ,some, words') {
+if !(&Tmp-String-5 == 'here, are ,some, words') {
test_fail
}
# String - network order representation of a 8 char string
&Tmp-uint64-0 := "%(integer:%{Tmp-String-1})"
-if (((integer64) &Tmp-String-1 != &Tmp-uint64-0) || (!(&Tmp-uint64-0 == 98709870))) {
+if (!((integer64) &Tmp-String-1 == &Tmp-uint64-0) || (!(&Tmp-uint64-0 == 98709870))) {
test_fail
}
&Tmp-String-0 := %(soh:OS)
# Complete set of data should match a real version of Windows
-if ("%{Tmp-String-0}" != "Windows Vista / Server 2008 6.0.6001 sp 1.0" ) {
+if !(&Tmp-String-0 == "Windows Vista / Server 2008 6.0.6001 sp 1.0" ) {
test_fail
}
test_fail
}
-if (&Tmp-String-1 != 'I like chicken I like liver') {
+if !(&Tmp-String-1 == 'I like chicken I like liver') {
test_fail
}
test_fail
}
-if (&Module-Failure-Message[0] != 'Failed compiling regex: quantifier does not follow a repeatable item') {
+if !(&Module-Failure-Message[0] == 'Failed compiling regex: quantifier does not follow a repeatable item') {
test_fail
}
test_fail
}
-if (&Module-Failure-Message[0] != 'Failed compiling regex: Empty expression') {
+if !(&Module-Failure-Message[0] == 'Failed compiling regex: Empty expression') {
test_fail
}
}