Add tests

This commit is contained in:
Dimitri Lozeve 2023-10-01 19:22:28 +02:00
parent 5ebb88f0ef
commit d6ddae4a55
2 changed files with 41 additions and 8 deletions

View file

@ -1,11 +1,35 @@
Get,Post•Import"curl.bqn"
rGet"http://localhost:8080/get"
r.code
r.headers
r.content
httpbinURL"http://localhost:8080"
r"Content-Type: application/json"Post"http://localhost:8080/post""{""key"": ""value""}"
r.code
r.headers
r.content
•Out " Test GET"
rGet httpbinURL"/get"
! 200=r.code
! 1="HTTP/"r.headers
! 1=+´"Content-Type: "r.headers
! 1=+´"Content-Length: "r.headers
! 1=+´"""Host"": ""localhost:8080"""r.content
! 1=+´"""User-Agent"": ""curl/bqn"""r.content
! 0=+´"""Hello"": ""World"""r.content
•Out "OK"
•Out " Test GET with headers"
r"User-Agent: toto","Content-Type: application/json","Hello: World"Get httpbinURL"/get"
! 200=r.code
! 1=+´"""Host"": ""localhost:8080"""r.content
! 1=+´"""User-Agent"": ""toto"""r.content
! 1=+´"""Content-Type"": ""application/json"""r.content
! 1=+´"""Hello"": ""World"""r.content
•Out "OK"
•Out " Test POST with headers"
r"Content-Type: application/json"PosthttpbinURL"/post","{""key"": ""value""}"
! 200=r.code
! 1="HTTP/"r.headers
! 1=+´"Content-Type: "r.headers
! 1=+´"Content-Length: "r.headers
! 1=+´"""Content-Type"": ""application/json"""r.content
! 1=+´"""data"": ""{\""key\"": \""value\""}"""r.content
•Out "OK"
•Out "All tests passed."