Fixing things for programs with very large output.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include <iostream>
|
||||
#include <filesystem>
|
||||
|
||||
#include "daggy/executors/ForkingExecutor.hpp"
|
||||
|
||||
@@ -26,4 +27,15 @@ TEST_CASE("Basic Execution", "[forking_executor]") {
|
||||
REQUIRE(rec.error == "/usr/bin/expr: syntax error: missing argument after ‘+’\n");
|
||||
REQUIRE(rec.output.empty());
|
||||
}
|
||||
|
||||
SECTION("Large Output") {
|
||||
const std::string BIG_FILE{"/usr/share/dict/cracklib-small"};
|
||||
std::vector<std::string> cmd{"/usr/bin/cat", BIG_FILE};
|
||||
|
||||
auto rec = ex.runCommand(cmd);
|
||||
|
||||
REQUIRE(rec.rc == 0);
|
||||
REQUIRE(rec.output.size() == std::filesystem::file_size(BIG_FILE));
|
||||
REQUIRE(rec.error.empty());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user