Skip to content

Commit

Permalink
Fix failing unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Jackson <[email protected]>
  • Loading branch information
imikejackson committed Oct 25, 2023
1 parent 634581f commit c829e82
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Plugins/ComplexCore/test/ExecuteProcessTest.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <catch2/catch.hpp>

#include "complex/ComplexVersion.hpp"
#include "complex/Parameters/BoolParameter.hpp"
#include "complex/Parameters/FileSystemPathParameter.hpp"
#include "complex/Parameters/NumberParameter.hpp"
Expand Down Expand Up @@ -45,10 +46,14 @@ TEST_CASE("ComplexCore::ExecuteProcessFilter: Valid filter execution")

std::ifstream processOutputFile(processOutput);
REQUIRE(processOutputFile.is_open());
std::stringstream buffer;
buffer << processOutputFile.rdbuf();

std::string firstLine;
std::getline(processOutputFile, firstLine);
firstLine = StringUtilities::rtrim(firstLine);
REQUIRE(firstLine == "nxrunner version 1.0.0");
std::vector<std::string> outputLines = complex::StringUtilities::split(buffer.str(), '\n');
firstLine = StringUtilities::trimmed(outputLines[0]);
const std::string correctOutput = fmt::format("nxrunner: Version {} Build Date:{}", complex::Version::Package(), complex::Version::BuildDate());
REQUIRE(firstLine == correctOutput);
}

TEST_CASE("ComplexCore::ExecuteProcessFilter: InValid filter execution")
Expand Down

0 comments on commit c829e82

Please sign in to comment.