test extracting an object

parent 273d0c05
......@@ -23,6 +23,7 @@ varnish v1 -vcl+backend {
p_test.expect(".f");
p_test.expect(".g.1");
p_test.expect(".g.h[0]");
p_test.expect(".g");
}
sub vcl_recv {
return (synth(200));
......@@ -64,6 +65,8 @@ varnish v1 -vcl+backend {
set resp.http.gh0 = p_test.extract(".g.h[0]");
set resp.http.gh0-type = p_test.type(".g.h[0]");
set resp.http.g = p_test.extract(".g");
set resp.http.g-type = p_test.type(".g");
}
} -start
......@@ -93,4 +96,6 @@ client c1 {
expect resp.http.g1-type == ARRAY
expect resp.http.gh0 == 7
expect resp.http.gh0-type == NUMBER
expect resp.http.g == {{ "1": [], h: [ 7 ] }}
expect resp.http.g-type == OBJECT
} -run
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment