unlink (709B)
- #!/usr/bin/env atf-sh
- # SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
- # SPDX-License-Identifier: MPL-2.0
- atf_test_case basic cleanup
- basic_body() {
- touch inputs/unlink-this || atf_fail "touch inputs/unlink-this"
- atf_check ../cmd/unlink inputs/unlink-this
- }
- basic_cleanup() {
- rm -f inputs/unlink-this || atf_fail "rm -f inputs/unlink-this"
- }
- atf_test_case enoent
- enoent_body() {
- # shellcheck disable=SC1112
- atf_check -s exit:1 -e 'inline:unlink: Cannot unlink ‘/var/empty/e/no/ent’: No such file or directory\n' ../cmd/unlink /var/empty/e/no/ent
- }
- atf_init_test_cases() {
- cd "$(atf_get_srcdir)" || exit 1
- atf_add_test_case basic
- atf_add_test_case enoent
- }