diff --git a/test/test_interpreter.cpp b/test/test_interpreter.cpp index 392b58d9..8ea110b1 100644 --- a/test/test_interpreter.cpp +++ b/test/test_interpreter.cpp @@ -48,3 +48,28 @@ TEST_SUITE("extract_filename") REQUIRE(argc == 2); } } + +TEST_SUITE("should_print_version") +{ + /* Checks when the right argument is passed*/ + TEST_CASE("should_print_version_with_version_arg") + { + + const char* arguments[] = {"argument1", "--version"}; + int argc = sizeof(arguments) / sizeof(arguments[0]);; + + bool result = xcpp::should_print_version(argc, const_cast(arguments)); + REQUIRE(result); + } + + /* Checks when the wrong argument is passed*/ + TEST_CASE("should_print_version_without_version_arg") + { + const char* arguments[] = {"argument1", "argument2"}; + int argc = sizeof(arguments) / sizeof(arguments[0]);; + + bool result = xcpp::should_print_version(argc, const_cast(arguments)); + + REQUIRE(!result); + } +} \ No newline at end of file