diff options
Diffstat (limited to 'tests/string.at')
-rw-r--r-- | tests/string.at | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/tests/string.at b/tests/string.at index 9bc4651..698ca4a 100644 --- a/tests/string.at +++ b/tests/string.at @@ -14,25 +14,25 @@ # 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(string) AT_KEYWORDS(string) -AT_CHECK([ -AT_VCL([variable.set("foo", req.http.Host); -variable.set("bar","two");], -[set resp.http.X-Foo = variable.get("foo"); - set resp.http.X-Bar = variable.get("bar");], -[txreq -url / -hdr "Host:en.example.net" - rxresp - expect resp.http.X-Foo == "en.example.net" - expect resp.http.X-Bar == "two" -]) -AT_VARNISHTEST -], -[0], -[OK +AT_VARNISHTEST([ +sub vcl_recv { + variable.set("foo", req.http.Host); + variable.set("bar","two"); +} +sub vcl_deliver { + set resp.http.X-Foo = variable.get("foo"); + set resp.http.X-Bar = variable.get("bar"); +} +],[ +txreq -url / -hdr "Host:en.example.net" +rxresp +expect resp.http.X-Foo == "en.example.net" +expect resp.http.X-Bar == "two" ]) AT_CLEANUP |