aboutsummaryrefslogtreecommitdiffstats
path: root/nihil.posix/execlp.test.cc
diff options
context:
space:
mode:
authorLexi Winter <lexi@le-fay.org>2025-06-30 09:10:16 +0100
committerLexi Winter <lexi@le-fay.org>2025-06-30 09:10:16 +0100
commit36427c0966faa7aecd586b397ed9b845f18172f5 (patch)
tree0d86c7ca9ac9e2e768b54d491bf596fb84f5e45a /nihil.posix/execlp.test.cc
parent034cd404a129103a8dd7747e6bd00ffd5550da93 (diff)
downloadnihil-36427c0966faa7aecd586b397ed9b845f18172f5.tar.gz
nihil-36427c0966faa7aecd586b397ed9b845f18172f5.tar.bz2
more refactoring; add stat()
Diffstat (limited to 'nihil.posix/execlp.test.cc')
-rw-r--r--nihil.posix/execlp.test.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/nihil.posix/execlp.test.cc b/nihil.posix/execlp.test.cc
index cedf871..aa32253 100644
--- a/nihil.posix/execlp.test.cc
+++ b/nihil.posix/execlp.test.cc
@@ -64,4 +64,18 @@ SCENARIO("nihil::execlp() returns the shell's exit code")
}
}
+SCENARIO("nihil::execlp() returns an error if the executable is not in $PATH")
+{
+ GIVEN("An execlp object for a non-existent executable")
+ {
+ auto exec = nihil::execlp("nihil_no_such_executable", "x");
+
+ THEN("A no_such_file_or_directory error is returned")
+ {
+ REQUIRE(!exec);
+ REQUIRE(exec.error().root_cause() == std::errc::no_such_file_or_directory);
+ }
+ }
+}
+
} // anonymous namespace