commit: 169b021d07af0f76b9dcde3a7edb4797244c5c5b
parent 78b1ce88a92f169486e96c84da0bb9fcb05f045d
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Sun, 7 Aug 2022 11:58:42 +0200
{true,false}: Add closefds tests
Diffstat:
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/false b/false
@@ -17,8 +17,17 @@ devfull_body() {
atf_check -s exit:1 false --help >/dev/full
}
+atf_test_case closefds
+closefds_body() {
+ atf_check -s exit:1 sh -c 'false --help >&-'
+ atf_check -s exit:1 sh -c 'false --help 2>&-'
+ atf_check -s exit:1 sh -c 'false --help <&-'
+ atf_check -s exit:1 sh -c 'false --help <&- >&- 2>&-'
+}
+
atf_init_test_cases() {
atf_add_test_case basic
atf_add_test_case nohelp
atf_add_test_case devfull
+ atf_add_test_case closefds
}
diff --git a/true b/true
@@ -17,8 +17,17 @@ devfull_body() {
atf_check true --help >/dev/full
}
+atf_test_case closefds
+closefds_body() {
+ atf_check sh -c 'true --help >&-'
+ atf_check sh -c 'true --help 2>&-'
+ atf_check sh -c 'true --help <&-'
+ atf_check sh -c 'true --help <&- >&- 2>&-'
+}
+
atf_init_test_cases() {
atf_add_test_case basic
atf_add_test_case nohelp
atf_add_test_case devfull
+ atf_add_test_case closefds
}