test_fail
}
-if (&reply.Reply-Message[0] != "call second") {
+if (!(&reply.Reply-Message[0] == "call second")) {
test_fail
}
-if (&reply.Reply-Message[1] != "call second post") {
+if (!(&reply.Reply-Message[1] == "call second post")) {
test_fail
}
test_fail
}
-if (&reply.Reply-Message[0] != "call second") {
+if (!(&reply.Reply-Message[0] == "call second")) {
test_fail
}
test_fail
}
-if (&request.Reply-Message[1] != "I am #literally a comment #") {
+if (!(&request.Reply-Message[1] == "I am #literally a comment #")) {
test_fail
}
&Tmp-String-1 = "%(concat:%{request.[*]} ', ')"
}
-if (&Tmp-String-1 != "bob, hello, ab c, de fg, 123") {
+if (!(&Tmp-String-1 == "bob, hello, ab c, de fg, 123")) {
test_fail
}
&Tmp-String-2 = "%(concat:%{Tmp-String-0[*]} ', ')"
}
-if (&Tmp-String-2 != "ab c, de fg") {
+if (!(&Tmp-String-2 == "ab c, de fg")) {
test_fail
}
&Tmp-String-3 = "%(concat:%{Tmp-String-0[*]})"
}
-if (&Tmp-String-3 != "ab cde fg") {
+if (!(&Tmp-String-3 == "ab cde fg")) {
test_fail
}
&Tmp-String-4 = "%(concat:%{Tmp-String-0[*]} ,)"
}
-if (&Tmp-String-4 != "ab c,de fg") {
+if (!(&Tmp-String-4 == "ab c,de fg")) {
test_fail
}
&Tmp-String-0 := %(date:%{Tmp-Integer-0})
# Some systems report GMT some UTC...
-if (&Tmp-String-0 != "Fri 22 Sep 17:25:00 GMT 2017") && (&Tmp-String-0 != "Fri 22 Sep 17:25:00 UTC 2017") {
+if (!(&Tmp-String-0 == "Fri 22 Sep 17:25:00 GMT 2017")) && (&Tmp-String-0 != "Fri 22 Sep 17:25:00 UTC 2017") {
test_fail
}
test_fail
}
-if (&Module-Failure-Message != "Can't convert type ipaddr into date") {
+if (!(&Module-Failure-Message == "Can't convert type ipaddr into date")) {
test_fail
}
}
&Tmp-String-8 := "%{string:%{Tmp-Octets-0}}"
-if (&Tmp-String-8 != "i have scary embedded things\000 inside me") {
+if (!(&Tmp-String-8 == "i have scary embedded things\000 inside me")) {
test_fail
}
-if (&Tmp-String-0 != "i have scary embedded things\000 inside me") {
+if (!(&Tmp-String-0 == "i have scary embedded things\000 inside me")) {
test_fail
}
test_fail
}
-if ("%{Tmp-String-0[0]}" != "i have scary embedded things\000 inside me") {
+if (!("%{Tmp-String-0[0]}" == "i have scary embedded things\000 inside me")) {
test_fail
}
#
# Simple
#
-if ("%{expr: 1 + 2 + 3 + 4}" != 10) {
+if (!(%{expr: 1 + 2 + 3 + 4} == 10)) {
test_fail
}
if (1 + 2 + 3 + 4 != 10) {
#
# Precedence
#
-if ("%{expr: 1 + 2 * 3 + 4}" != 11) {
+if (!(%{expr: 1 + 2 * 3 + 4} == 11)) {
test_fail
}
if (1 + 2 * 3 + 4 != 11) {
&Tmp-Integer-2 := 4
&Tmp-Date-0 := "%l"
-if ("%{expr: 1 + 2 * &Tmp-Integer-1 + 4}" != 11) {
+if (!(%{expr: 1 + 2 * &Tmp-Integer-1 + 4} == 11)) {
test_fail
}
if (1 + 2 * &Tmp-Integer-1 + 4 != 11) {
}
-if ("%{expr: 1 + 2 * (&Tmp-Integer-1 + 4)}" != 15) {
+if (!(%{expr: 1 + 2 * (&Tmp-Integer-1 + 4)} == 15)) {
test_fail
}
if (1 + 2 * (&Tmp-Integer-1 + 4) != 15) {
test_fail
}
-if ("%{expr: 1 + 2 * (&Tmp-Integer-1 + &Tmp-Integer-2)}" != 15) {
+if (!(%{expr: 1 + 2 * (&Tmp-Integer-1 + &Tmp-Integer-2)} == 15)) {
test_fail
}
if (1 + 2 * (&Tmp-Integer-1 + &Tmp-Integer-2) != 15) {
test_fail
}
-if ("%{expr: 1 & ~1}" != 0) {
+if (!(%{expr: 1 & ~1} == 0)) {
test_fail
}
if ((1 & ~1) != 0) { # needs an extra () to resolve ambiguities and warnings
test_fail
}
-if ("%{expr: 1 & ~2}" != 1) {
+if (!(%{expr: 1 & ~2} == 1)) {
test_fail
}
if ((1 & ~2) != 1) { # needs an extra () to resolve ambiguities and warnings
test_fail
}
-if ("%{expr: -1 * 2}" != -2) {
+if (!(%{expr: -1 * 2} == -2)) {
test_fail
}
if (-1 * 2 != -2) {
test_fail
}
-if ("%{expr: 11 % 2}" != 1) {
+if (!(%{expr: 11 % 2} == 1)) {
test_fail
}
if (11 % 2 != 1) {
test_fail
}
-if ("%{expr: 2 - -1}" != 3) {
+if (!(%{expr: 2 - -1} == 3)) {
test_fail
}
if (2 - -1 != 3) {
test_fail
}
-if ("%{expr: 1 << 2 | 1}" != 5) {
+if (!(%{expr: 1 << 2 | 1} == 5)) {
test_fail
}
if (((1 << 2) | 1) != 5) { # needs extra () to resolve precedence
#
# Unary negation
#
-if ("%{expr: 6 + -(1 + 3)}" != 2) {
+if (!(%{expr: 6 + -(1 + 3)} == 2)) {
test_fail
}
if (6 + -(1 + 3) != 2) {
test_fail
}
-if ("%{expr: 6 * -&Tmp-Integer-2}" != -24) {
+if (!(%{expr: 6 * -&Tmp-Integer-2} == -24)) {
test_fail
}
if (6 * -&Tmp-Integer-2 != -24) {
test_fail
}
-if (&Module-Failure-Message[*] != "No previous named regex capture group") {
+if (!(&Module-Failure-Message[*] == "No previous named regex capture group")) {
test_fail
}
}
test_fail
}
-if (&Module-Failure-Message[*] != "No previous regex capture") {
+if (!(&Module-Failure-Message[*] == "No previous regex capture")) {
test_fail
}
test_fail
}
-if (&Module-Failure-Message != "No previous named regex capture group") {
+if (!(&Module-Failure-Message == "No previous named regex capture group")) {
test_fail
}
test_fail
}
-if (&Module-Failure-Message != "No previous numbered regex capture group") {
+if (!(&Module-Failure-Message == "No previous numbered regex capture group")) {
test_fail
}
#
&control.Tmp-String-1 := "%(concat:%(join:%{request.[*]} %{control.Tmp-IP-Address-0}) '. ')"
-if (&control.Tmp-String-1 != "bob. hello. ab c. de fg. 123. 192.168.1.254") {
+if (!(&control.Tmp-String-1 == "bob. hello. ab c. de fg. 123. 192.168.1.254")) {
test_fail
}
&Tmp-String-2 := "%(concat:%(join:%{Tmp-String-0[*]} %{Tmp-Integer-0}) ,)"
-if (&Tmp-String-2 != "ab c,de fg,123") {
+if (!(&Tmp-String-2 == "ab c,de fg,123")) {
test_fail
}
test_fail
}
-if ("%{map:request.Tmp-Group-0.Tmp-String-1 := 'testing000'}" != 1) {
+if (!(%{map:request.Tmp-Group-0.Tmp-String-1 := 'testing000'} == 1)) {
test_fail
}
test_fail
}
-if (&Module-Failure-Message != "Invalid MS-CHAP challenge length") {
+if (!(&Module-Failure-Message == "Invalid MS-CHAP challenge length")) {
test_fail
}
#
# rpad tests
#
-if ("%(rpad:%{Tmp-String-0} 7)" != "test ") {
+if (!(%(rpad:%{Tmp-String-0} 7) == "test ")) {
test_fail
}
-if ("%(rpad:%{Tmp-String-0} 2)" != "test") {
+if (!(%(rpad:%{Tmp-String-0} 2) == "test")) {
test_fail
}
-if ("%(rpad:%{Tmp-String-0} 7 x)" != "testxxx") {
+if (!(%(rpad:%{Tmp-String-0} 7 x) == "testxxx")) {
test_fail
}
-if ("%(rpad:%{Tmp-String-0} 7 xy)" != "testxyx") {
+if (!(%(rpad:%{Tmp-String-0} 7 xy) == "testxyx")) {
test_fail
}
#
# lpad tests
#
-if ("%(lpad:%{Tmp-String-0} 7)" != " test") {
+if (!(%(lpad:%{Tmp-String-0} 7) == " test")) {
test_fail
}
-if ("%(lpad:%{Tmp-String-0} 2)" != "test") {
+if (!(%(lpad:%{Tmp-String-0} 2) == "test")) {
test_fail
}
-if ("%(lpad:%{Tmp-String-0} 7 x)" != "xxxtest") {
+if (!(%(lpad:%{Tmp-String-0} 7 x) == "xxxtest")) {
test_fail
}
-if ("%(lpad:%{Tmp-String-0} 7 xy)" != "xyxtest") {
+if (!(%(lpad:%{Tmp-String-0} 7 xy) == "xyxtest")) {
test_fail
}
test_fail
}
-if (&Module-Failure-Message != "unpack offset 10 is larger than input data length 5") {
+if (!(&Module-Failure-Message == "unpack offset 10 is larger than input data length 5")) {
test_fail
}
&request -= &Module-Failure-Message[*]
test_fail
}
-if (&Module-Failure-Message != "Invalid data type 'thing'") {
+if (!(&Module-Failure-Message == "Invalid data type 'thing'")) {
test_fail
}
test_fail
}
-if (&Module-Failure-Message != "unpack requires the input attribute to be 'string' or 'octets'") {
+if (!(&Module-Failure-Message == "unpack requires the input attribute to be 'string' or 'octets'")) {
test_fail
}
&request -= &Module-Failure-Message[*]
test_fail
}
-if (&Module-Failure-Message != "Invalid hex string in '0x014sdgw'") {
+if (!(&Module-Failure-Message == "Invalid hex string in '0x014sdgw'")) {
test_fail
}
&request -= &Module-Failure-Message[*]
test_fail
}
-if (&Module-Failure-Message != "Zero length hex string in '0x'") {
+if (!(&Module-Failure-Message == "Zero length hex string in '0x'")) {
test_fail
}
&Tmp-String-0 = `/bin/sh -c "echo 'foo bar baz'"`
}
-if (!&Tmp-String-0 || (&Tmp-String-0 != "foo bar baz")) {
+if (!&Tmp-String-0 || (!(&Tmp-String-0 == "foo bar baz"))) {
test_fail
}
}
# 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
}
}
# 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
}
}
# 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
}
&Tmp-String-0 = "foo"
&Tmp-String-1 := `/bin/echo hello 1234:%{Tmp-String-0} world`
-if (&Tmp-String-1 != "hello 1234:foo world") {
+if (!(&Tmp-String-1 == "hello 1234:foo world")) {
test_fail
}
&Tmp-String-1 := `/bin/echo hello %{Tmp-String-0}:1234 world`
-if (&Tmp-String-1 != "hello foo:1234 world") {
+if (!(&Tmp-String-1 == "hello foo:1234 world")) {
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
}
#
# Global substitution
-if ("%(subst:%{Tmp-String-0} a b)" != 'bbb') {
+if (!(%(subst:%{Tmp-String-0} a b) == 'bbb')) {
test_fail
}
# No match
-if ("%(subst:%{Tmp-String-0} c b)" != 'aaa') {
+if (!(%(subst:%{Tmp-String-0} c b) == 'aaa')) {
test_fail
}
# Line ending rewrite
-if ("%(subst:%{Tmp-String-1} \n \r)" != "\r\r\r") {
+if (!(%(subst:%{Tmp-String-1} \n \r) == "\r\r\r")) {
test_fail
}
# Removal
-if ("%(subst:%{Tmp-String-0} a '')" != "") {
+if (!(%(subst:%{Tmp-String-0} a '') == "")) {
test_fail
}
# Removal of last word only
-if ("%(subst:%{Tmp-String-2} dog '')" != "the quick brown fox jumped over the lazy ") {
+if (!(%(subst:%{Tmp-String-2} dog '') == "the quick brown fox jumped over the lazy ")) {
test_fail
}
# Removal of first and subsequent word
-if ("%(subst:%{Tmp-String-2} the '')" != " quick brown fox jumped over lazy dog") {
+if (!(%(subst:%{Tmp-String-2} the '') == " quick brown fox jumped over lazy dog")) {
test_fail
}
# Removal of middle word
-if ("%(subst:%{Tmp-String-2} jumped '')" != "the quick brown fox over the lazy dog") {
+if (!(%(subst:%{Tmp-String-2} jumped '') == "the quick brown fox over the lazy dog")) {
test_fail
}
# Replacement of last word only
-if ("%(subst:%{Tmp-String-2} dog cat)" != "the quick brown fox jumped over the lazy cat") {
+if (!(%(subst:%{Tmp-String-2} dog cat) == "the quick brown fox jumped over the lazy cat")) {
test_fail
}
# Replacement of first and subsequent word
-if ("%(subst:%{Tmp-String-2} the cat)" != "cat quick brown fox jumped over cat lazy dog") {
+if (!(%(subst:%{Tmp-String-2} the cat) == "cat quick brown fox jumped over cat lazy dog")) {
test_fail
}
# Replacement of middle word
-if ("%(subst:%{Tmp-String-2} jumped cat)" != "the quick brown fox cat over the lazy dog") {
+if (!(%(subst:%{Tmp-String-2} jumped cat) == "the quick brown fox cat over the lazy dog")) {
test_fail
}
if ("${feature.regex-pcre2}" == 'yes') {
# Basic substitutions
-if ("%(subst:%{Tmp-String-0} /a/ b)" != 'baa') {
+if (!(%(subst:%{Tmp-String-0} /a/ b) == 'baa')) {
test_fail
}
# Global substitution
-if ("%(subst:%{Tmp-String-0} /a/g b)" != 'bbb') {
+if (!(%(subst:%{Tmp-String-0} /a/g b) == 'bbb')) {
test_fail
}
# No match
-if ("%(subst:%{Tmp-String-0} /z/ b)" != 'aaa') {
+if (!(%(subst:%{Tmp-String-0} /z/ b) == 'aaa')) {
test_fail
}
}
# Strip out just the first newline
-if ("%(subst:%{Tmp-String-1} /^./s '')" != "\n\n") {
+if (!(%(subst:%{Tmp-String-1} /^./s '') == "\n\n")) {
test_fail
}
-if ("%(subst:%{Tmp-String-1} /\n/ '')" != "\n\n") {
+if (!(%(subst:%{Tmp-String-1} /\n/ '') == "\n\n")) {
test_fail
}
# Strip out all the newlines
-if ("%(subst:%{Tmp-String-1} /\n/g '')" != '') {
+if (!(%(subst:%{Tmp-String-1} /\n/g '') == '')) {
test_fail
}
# Line ending switch
-if ("%(subst:%{Tmp-String-1} /\n/g \r)" != "\r\r\r") {
+if (!(%(subst:%{Tmp-String-1} /\n/g \r) == "\r\r\r")) {
test_fail
}