Run all tests with:
./run-tests.shNOTE: For the best experience, run Bash inside VS Code.
This tool provides simple test assertions for shell scripts.
Example usage:
#!/bin/bash
source ./assert/assert-equals.sh
command() {
./src/my-flag-parser.sh $1 $2
}
assert-equals "Flag --my-flag not found" "$(command)"
assert-equals "Flag --my-flag found" "$(command --my-flag)"
assert-equals "Flag --my-flag found" "$(command --my-flag=1)"
assert-equals "Flag --my-flag found. It's value is 'value'" "$(command --my-flag value)"
assert-equals "Flag --my-flag found. It's value is 'value'" "$(command --my-flag=valu)"- Fix the issue with relative paths
