aboutsummaryrefslogtreecommitdiff
path: root/tests/real.at
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2015-02-12 12:38:20 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2015-02-12 12:38:20 +0200
commitc36a2210ed6cd53c5c65418fa9c20ac22dec8c59 (patch)
tree95cbf77e8d0851e5ea2b9adaba7ad12c6bf0e1c4 /tests/real.at
parentb771edaa218bee8a8365cc8e4ee9af4005ad61b2 (diff)
downloadvmod-variable-c36a2210ed6cd53c5c65418fa9c20ac22dec8c59.tar.gz
vmod-variable-c36a2210ed6cd53c5c65418fa9c20ac22dec8c59.tar.bz2
Implement global string variables
* src/variable.c (vmod_global_set) (vmod_global_get): New functions. * src/variable.vcc (global_set) (global_get): New protos. * tests/gstring.at: New file. * tests/Makefile.am (TESTSUITE_AT): Add gstring.at * tests/testsuite.at (AT_VCL): Remove (AT_VARNISHTEST): Rewrite. All uses changed. Include gstring.at * tests/atlocal.in (at_vcl_backend): Remove. * tests/batchset.at: Use new AT_VARNISHTEST. * tests/clear.at: Likewise. * tests/complex.at: Likewise. * tests/defined.at: Likewise. * tests/duration.at: Likewise. * tests/int.at: Likewise. * tests/real.at: Likewise. * tests/string.at: Likewise. * tests/type_of.at: Likewise. * tests/undef.at: Likewise.
Diffstat (limited to 'tests/real.at')
-rw-r--r--tests/real.at26
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/real.at b/tests/real.at
index f6faa94..3500480 100644
--- a/tests/real.at
+++ b/tests/real.at
@@ -17,20 +17,20 @@
AT_SETUP(real)
AT_KEYWORDS(real)
-AT_CHECK([
-AT_VCL([variable.set_real("one-half", 0.5);
-variable.set_real("one-fourth",0.25);],
-[set resp.http.X-One-Fourth = variable.get_real("one-fourth");
- set resp.http.X-One-Half = variable.get_real("one-half");],
+AT_VARNISHTEST([
+sub vcl_recv {
+ variable.set_real("one-half", 0.5);
+ variable.set_real("one-fourth",0.25);
+}
+sub vcl_deliver {
+ set resp.http.X-One-Fourth = variable.get_real("one-fourth");
+ set resp.http.X-One-Half = variable.get_real("one-half");
+}
+],
[txreq -url /
- rxresp
- expect resp.http.X-One-Half == "0.500"
- expect resp.http.X-One-Fourth == "0.250"
-])
-AT_VARNISHTEST
-],
-[0],
-[OK
+rxresp
+expect resp.http.X-One-Half == "0.500"
+expect resp.http.X-One-Fourth == "0.250"
])
AT_CLEANUP

Return to:

Send suggestions and report system problems to the System administrator.