Add some tests
This commit is contained in:
parent
2345f6c27c
commit
f00a7b7cc4
40
test/api.hurl
Normal file
40
test/api.hurl
Normal file
|
@ -0,0 +1,40 @@
|
|||
GET http://localhost:8080/
|
||||
HTTP 200
|
||||
[Asserts]
|
||||
header "Content-Type" contains "text/html"
|
||||
|
||||
|
||||
POST http://localhost:8080/v1/exec
|
||||
content-type: application/json
|
||||
```
|
||||
{
|
||||
"sandbox": "hare",
|
||||
"command": "run",
|
||||
"files": {
|
||||
"": "use fmt;\nexport fn main() void = {\nfmt::println(\"hello world\")!;\n};\n"
|
||||
}
|
||||
}
|
||||
```
|
||||
HTTP 200
|
||||
[Asserts]
|
||||
jsonpath "$.ok" == true
|
||||
jsonpath "$.stdout" == "hello world\n"
|
||||
jsonpath "$.stderr" == ""
|
||||
|
||||
|
||||
POST http://localhost:8080/v1/exec
|
||||
content-type: application/json
|
||||
```
|
||||
{
|
||||
"sandbox": "hare",
|
||||
"command": "run",
|
||||
"files": {
|
||||
"": "use fmt;\nexport fn main()\n"
|
||||
}
|
||||
}
|
||||
```
|
||||
HTTP 200
|
||||
[Asserts]
|
||||
jsonpath "$.ok" == true
|
||||
jsonpath "$.stdout" == ""
|
||||
jsonpath "$.stderr" matches "syntax error"
|
Loading…
Reference in a new issue