unlink (735B)
- #!/usr/bin/env atf-sh
- # SPDX-FileCopyrightText: 2017-2022 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
- # SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
- atf_test_case basic cleanup
- basic_body() {
- touch inputs/unlink-this || atf_fail "touch inputs/unlink-this"
- atf_check ../bin/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' ../bin/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
- }