* 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
17 lines
237 B
Bash
Executable File
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
|
|
}
|