mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-11-24 04:31:37 +03:00
20 lines
399 B
Bash
Executable File
20 lines
399 B
Bash
Executable File
#!/bin/bash
|
|
# Export AST to json
|
|
set -u
|
|
set -eo pipefail
|
|
for hurl_file in "$@"; do
|
|
json_file="${hurl_file%.*}.json"
|
|
cmd="hurlfmt --output json $hurl_file"
|
|
echo "$cmd"
|
|
|
|
$cmd >/tmp/test.stdout
|
|
expected=$(cat "$json_file")
|
|
actual=$(cat /tmp/test.stdout)
|
|
if [ "$actual" != "$expected" ]; then
|
|
diff <(echo "$actual" ) <(echo "$expected")
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
|