Add more integ tests for hurlfmt --in curl

This commit is contained in:
Fabrice Reix 2023-04-24 14:16:23 +02:00
parent b90dbf4925
commit 4550e75ae2
No known key found for this signature in database
GPG Key ID: BF5213154B2E7155
4 changed files with 18 additions and 2 deletions

View File

@ -1,3 +1,7 @@
curl http://localhost:8000/hello
curl http://localhost:8000/custom-headers -H 'Fruit:Raspberry' -H 'Fruit:Apple' -H 'Fruit:Banana' -H 'Fruit: Grape' -H 'Color:Green'
curl --header 'Content-Type: application/json' --data $'{\n "name": "Bob",\n "password": "&secret\\\\\'<>",\n "age": 30,\n "strict": true,\n "spacing": "\\n",\n "g_clef": "\\uD834\\uDD1E",\n "items": [true, "true", 1],\n "variable": "\\\\"\n}' 'http://localhost:8000/post-json'
curl --header 'Content-Type:' --data '@tests_ok/data.bin' 'http://localhost:8000/post-file'
curl --location 'http://localhost:8000/redirect-absolute'
curl -k https://localhost:8001/hello

View File

@ -22,3 +22,15 @@ Content-Type: application/json
}
```
POST http://localhost:8000/post-file
Content-Type:
file, tests_ok/data.bin;
GET http://localhost:8000/redirect-absolute
[Options]
location: true
GET https://localhost:8001/hello
[Options]
insecure: true

View File

@ -1,4 +1,4 @@
Set-StrictMode -Version latest
$ErrorActionPreference = 'Stop'
hurl tests_ok/import_curl.out > $null # Validate expected file
hurl --file-root . tests_ok/import_curl.out > $null # Validate expected file
hurlfmt --in curl tests_ok/import_curl.in

View File

@ -1,4 +1,4 @@
#!/bin/bash
set -Eeuo pipefail
hurl tests_ok/import_curl.out >/dev/null # Validate expected file
hurl --file-root . tests_ok/import_curl.out >/dev/null # Validate expected file
hurlfmt --in curl tests_ok/import_curl.in