File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,31 @@ TEST_SUITE("extract_filename")
4545
4646 std::string result = xcpp::extract_filename (argc, const_cast <char **>(arguments));
4747 REQUIRE (result == " filename.txt" );
48- REQUIRE (argc == 2 );
48+ REQUIRE (argc == 3 );
4949 }
5050}
51+
52+ TEST_SUITE (" should_print_version" )
53+ {
54+ /* Checks when the right argument is passed*/
55+ TEST_CASE (" should_print_version_with_version_arg" )
56+ {
57+
58+ const char * arguments[] = {" argument1" , " --version" };
59+ int argc = sizeof (arguments) / sizeof (arguments[0 ]);;
60+
61+ bool result = xcpp::should_print_version (argc, const_cast <char **>(arguments));
62+ REQUIRE (result);
63+ }
64+
65+ /* Checks when the wrong argument is passed*/
66+ TEST_CASE (" should_print_version_without_version_arg" )
67+ {
68+ const char * arguments[] = {" argument1" , " argument2" };
69+ int argc = sizeof (arguments) / sizeof (arguments[0 ]);;
70+
71+ bool result = xcpp::should_print_version (argc, const_cast <char **>(arguments));
72+
73+ REQUIRE (!result);
74+ }
75+ }
You can’t perform that action at this time.
0 commit comments