squid-
cache.org
Optimising Web Delivery
Docs
Download
Donate
Support
About
Contact
Shop
Blog
test-suite
ESIExpressions.cc
Go to the documentation of this file.
1
/*
2
* Copyright (C) 1996-2023 The Squid Software Foundation and contributors
3
*
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.
7
*/
8
9
/* DEBUG: section 86 ESI Expressions */
10
11
#include "
squid.h
"
12
#include "
esi/Expression.h
"
13
14
int
15
main
()
16
{
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"
,
21
"!('a'<='c')"
,
22
"(1==1)|('abc'=='def')"
,
23
"(4!=5)&(4==5)"
,
24
"(1==1)|(2==3)&(3==4)"
,
/* should be true because of precedence */
25
"(1 & 4)"
,
26
"(\"abc\" | \"edf\")"
,
"1==1==1"
,
27
"!('')"
,
28
/* End of array */
""
29
};
30
31
int
results[] = {0, 1, 0, 0, 1,
32
1, 0, 0, 1, 1,
33
0, 0, 1, 1, 0,
34
1, 0, 0, 1, 0,
35
1, 0, 0, 0, 0,
36
1, 0
37
};
38
39
int
i = 0;
40
41
while
(strlen (expressions[i])) {
42
int
result =
ESIExpression::Evaluate
(expressions[i]);
43
44
if
(result != results[i])
45
return
1;
46
47
++i;
48
}
49
50
return
0;
51
}
52
main
int main()
Definition:
ESIExpressions.cc:15
Expression.h
ESIExpression::Evaluate
static int Evaluate(char const *)
Definition:
Expression.cc:1000
squid.h
Introduction
About Squid
Why Squid?
Squid Developers
How to Donate
How to Help Out
Getting Squid
Squid Source Packages
Squid Deployment Case-Studies
Squid Software Foundation
Documentation
Quick Setup
Configuration:
Reference
Examples
FAQ
and
Wiki
Guide Books:
Beginners
Definitive
Non-English
More...
Support
Security Advisories
Bugzilla Database
Mailing lists
Contacting us
Commercial services
Project Sponsors
Squid-based products
Miscellaneous
Developer Resources
Related Writings
Related Software:
Authenticators
Ecap
Icap
Ident
Log Analysis
Monitor
Proxies
Redirectors
General
Squid Artwork
Web Site Translations
Japanese
Mirrors
Website:
gr
il
pl
...
full list
FTP Package Archive