diff options
| author | Lexi Winter <lexi@le-fay.org> | 2025-06-30 09:10:16 +0100 |
|---|---|---|
| committer | Lexi Winter <lexi@le-fay.org> | 2025-06-30 09:10:16 +0100 |
| commit | 36427c0966faa7aecd586b397ed9b845f18172f5 (patch) | |
| tree | 0d86c7ca9ac9e2e768b54d491bf596fb84f5e45a /nihil.posix/execlp.test.cc | |
| parent | 034cd404a129103a8dd7747e6bd00ffd5550da93 (diff) | |
| download | nihil-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.cc | 14 |
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 |
