mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-12-19 08:42:06 +03:00
20 lines
411 B
Bash
Executable File
20 lines
411 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 --json $hurl_file"
|
|
echo "$cmd"
|
|
|
|
$cmd 2>/tmp/test.stderr >/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
|
|
|
|
|