Skip to content

Commit

Permalink
Updated sample program logics
Browse files Browse the repository at this point in the history
  • Loading branch information
bialger committed Jan 22, 2024
1 parent e018a47 commit af168c8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ cmake --build cmake-build --target cpp_tests_tests
* On Windows:

```shell
.\cmake-build\bin\cpp_tests.exe "Hello, World" || .\cmake-build\bin\Debug\cpp_tests.exe "Hello, World"
.\cmake-build\bin\cpp_tests.exe World || .\cmake-build\bin\Debug\cpp_tests.exe World
```

* On POSIX:

```shell
./cmake-build/bin/cpp_tests "Hello, World"
./cmake-build/bin/cpp_tests World
```

5. Run tests
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/ui_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ int32_t StartConsoleUI(const std::vector<std::string>& args, std::ostream& out)
}

MyClass printer(out);
printer.Print(args[1] + "\n");
printer.Print("Hello, " + args[1] + "!\n");
return 0;
}
6 changes: 3 additions & 3 deletions tests/main_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ TEST_F(ProjectIntegrationTestSuite, InitTest) {

TEST_F(ProjectIntegrationTestSuite, PositiveTest1) {
std::ostringstream out;
ASSERT_EQ(StartConsoleUI(SplitString("test Hello!"), out), 0);
ASSERT_EQ(StartConsoleUI(SplitString("test World"), out), 0);
}

TEST_F(ProjectIntegrationTestSuite, PositiveOutputTest1) {
std::ostringstream out;
StartConsoleUI(SplitString("test Hello!"), out);
ASSERT_EQ(out.str(), "Hello!\n");
StartConsoleUI(SplitString("test World"), out);
ASSERT_EQ(out.str(), "Hello, World!\n");
}

TEST_F(ProjectIntegrationTestSuite, NegativeTest1) {
Expand Down

0 comments on commit af168c8

Please sign in to comment.