Re: [Htt-users] Poll
Brought to you by:
ia97lies
|
From: Christian L. <li...@gm...> - 2012-07-19 05:54:05
|
Another aproach would be remove the odd "_" and use lower case letters.
This would look like that.
client
req localhost 8080
__GET / HTTP/1.1
__Host: localhost:8080
__
expect . "foo"
wait
end
And a migration script would be easy to write. Even adjust the
documentation could be done automaticaly. More ideas?
--
Christian
On 07/18/12 12:50, Christian Liesch wrote:
> I think about an new major release for httest with signifcant syntax
> changes. But still not sure how to do this. Here is a sample it could
> look like:
>
> CLIENT
> store = {}
> function foo(a)
> end
>
> function bla(c)
> end
>
> foo("hallo")
> bla("heho")
>
> auto_close(true)
>
> connect(
> "https://127.0.0.1:8080",
> ssl:set_cert("foo.cert.pem", "foo.key.pem", "foo.ca.pem")
> )
>
> __GET / HTTP/1.1
> __Host: localhost:8080
> __
> expect(body, "foo")
> match(header, "Set-Cookie: mycookie=([^;]+)" cookie)
> wait()
>
> bps(200, function()
> __GET / HTTP/1.1
> __Host: localhost:8080
> __Cookie: mycookie=$cookie
> __
> wait()
> end)
>
> for i=1,10 do
> __GET / HTTP/1.1
> __Host: localhost:8080
> __
> expect(body, "foo");
> wait()
> end
> END
>
> But this looks not that readable as the old syntax. It is a mixup of
> lua and httest syntax. The only command I would make with httest would
> be __ and _-. Then I need a compilation step to embedd this httest
> commands to lua.
>
> Any other suggestions?
>
> Thanks
> Christian
|