hypersolana/.buildkite/scripts/func-assert-eq.sh
Yihau Chen 17eab32ad0
ci: run stable tests partially (#31151)
* ci: run stable tests partially

* ci: improve uploading test result

* use buildkite's retry

* test common

* fix indent issue

* extract assert eq

* use diff to print test error

* pretty format

* test build stable steps

* add test all function

* lint

* lint

* keep dollar sign

* switch got and want's diff direction

* use 'EOF' to make code more readable

* rename EMPTY_LINE to DELETE_THIS_LINE

* rename N => INDEX

* rename M => LIMIT

* check variable in a more elegant way

* wording

* more explain for code
2023-04-21 14:51:17 +08:00

17 lines
237 B
Bash
Executable File

#!/usr/bin/env bash
assert_eq() {
local test_name=$1
local want=$2
local got=$3
if [[ "$want" = "$got" ]]; then
echo "✅ $test_name"
else
cat <<EOF
❌ $test_name
$(diff -u <(echo "$want") <(echo "$got"))
EOF
fi
}