]>
git.ipfire.org Git - thirdparty/squid.git/blob - test-suite/ESIExpressions.cc
2 * Copyright (C) 1996-2019 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 /* DEBUG: section 86 ESI Expressions */
12 #include "esi/Expression.h"
17 char const *expressions
[] = {
18 "!(1==1)", "!(1!=1)", "1!=1", "!1==1", "1==1",
19 "1 <=1","2<=1", "1 < 1", "1 < 2", "-1 < 1","!-1<1",
20 "1>2","2>1","2>=2", "2>3", "1==1&1==1","1==1&1==0",
22 "(1==1)|('abc'=='def')",
24 "(1==1)|(2==3)&(3==4)", /* should be true because of precedence */
26 "(\"abc\" | \"edf\")", "1==1==1",
31 int results
[] = {0, 1, 0, 0, 1,
41 while (strlen (expressions
[i
])) {
42 int result
= ESIExpression::Evaluate (expressions
[i
]);
45 printf("Expr '%s' = '%s' (expected %s)\n", expressions
[i
],
46 result
? "true" : "false",
47 results
[i
] ? "true" : "false");
50 if (result
!= results
[i
])