Files
args/tests/test.bats
2026-01-14 20:59:18 +05:30

27 lines
490 B
Bash

setup(){
export PATH="${PWD}/build:${PATH}"
load 'test_helper/bats-support/load'
load 'test_helper/bats-assert/load'
}
@test "command found" {
run command -v args
assert_output --partial args
}
@test "no args? you fail." {
run args
assert_output --partial "args obviously needs arguments to work…"
assert_failure
}
@test "one arg" {
run args one
assert_output --partial "@1"$'\t'"one"
}
@test "represent empty string" {
run args ''
assert_output --partial "@1"$'\t'"''"
}