aboutsummaryrefslogtreecommitdiff
path: root/tests/type_of.at
diff options
context:
space:
mode:
Diffstat (limited to 'tests/type_of.at')
-rw-r--r--tests/type_of.at33
1 files changed, 16 insertions, 17 deletions
diff --git a/tests/type_of.at b/tests/type_of.at
index 2aeda17..8d8b7e8 100644
--- a/tests/type_of.at
+++ b/tests/type_of.at
@@ -14,28 +14,27 @@
# You should have received a copy of the GNU General Public License
# along with vmod-variable. If not, see <http://www.gnu.org/licenses/>.
AT_SETUP(type_of)
AT_KEYWORDS(type_of)
-AT_CHECK([
-AT_VCL([variable.set("s", "test");
-variable.set_int("i", 1);
-],
-[set resp.http.X-S = variable.type_of("s");
- set resp.http.X-I = variable.type_of("i");
- set resp.http.X-Y = variable.type_of("y");],
-[txreq -url /
- rxresp
- expect resp.http.X-S == "STRING"
- expect resp.http.X-I == "INT"
- expect resp.http.X-Y == "UNSET"
-])
-AT_VARNISHTEST
-],
-[0],
-[OK
+AT_VARNISHTEST([
+sub vcl_recv {
+ variable.set("s", "test");
+ variable.set_int("i", 1);
+}
+sub vcl_deliver {
+ set resp.http.X-S = variable.type_of("s");
+ set resp.http.X-I = variable.type_of("i");
+ set resp.http.X-Y = variable.type_of("y");
+}
+],[
+txreq -url /
+rxresp
+expect resp.http.X-S == "STRING"
+expect resp.http.X-I == "INT"
+expect resp.http.X-Y == "UNSET"
])
AT_CLEANUP

Return to:

Send suggestions and report system problems to the System administrator.