diff options
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 |
