Skip to content

Commit

Permalink
[MISC] Remove the name CHOPPER from error messages. (#247)
Browse files Browse the repository at this point in the history
* [MISC] Remove the name CHOPPER from error messages.

* fix test
  • Loading branch information
smehringer authored Aug 15, 2024
1 parent 861e2e0 commit 467e7a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/chopper_layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ int chopper_layout(chopper::configuration & config, sharg::parser & parser)
}
catch (sharg::parser_error const & ext) // the user did something wrong
{
std::cerr << "[CHOPPER ERROR] " << ext.what() << '\n'; // customize your error message
std::cerr << "[ERROR] " << ext.what() << '\n'; // customize your error message
return -1;
}

Expand Down Expand Up @@ -74,7 +74,7 @@ int chopper_layout(chopper::configuration & config, sharg::parser & parser)
}
catch (std::exception const & ext)
{
std::cerr << "[CHOPPER ERROR] " << ext.what() << '\n';
std::cerr << "[ERROR] " << ext.what() << '\n';
return -1;
}

Expand Down
6 changes: 3 additions & 3 deletions test/cli/cli_chopper_basic_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ TEST_F(cli_test, no_options)
TEST_F(cli_test, chopper_cmd_error_unknown_option)
{
cli_test_result result = execute_app("chopper", "--unkown-option");
std::string expected{"[CHOPPER ERROR] Option --input is required but not set.\n"};
std::string expected{"[ERROR] Option --input is required but not set.\n"};
EXPECT_EQ(result.exit_code, 65280);
EXPECT_EQ(result.out, std::string{});
EXPECT_EQ(result.err, expected);
Expand All @@ -52,7 +52,7 @@ TEST_F(cli_test, chopper_cmd_error_empty_file)
"--input",
empty_file.c_str());

std::string expected{"[CHOPPER ERROR] The file " + empty_file.string() + " appears to be empty.\n"};
std::string expected{"[ERROR] The file " + empty_file.string() + " appears to be empty.\n"};
EXPECT_EQ(result.exit_code, 65280);
EXPECT_EQ(result.out, std::string{});
EXPECT_EQ(result.err, expected);
Expand All @@ -74,7 +74,7 @@ TEST_F(cli_test, chopper_cmd_non_existing_path_in_input)
"--input",
non_existing_content.c_str());

std::string expected{"[CHOPPER ERROR] File /I/do/no/exist.fa does not exist!\n"};
std::string expected{"[ERROR] File /I/do/no/exist.fa does not exist!\n"};
EXPECT_EQ(result.exit_code, 65280);
EXPECT_EQ(result.out, std::string{});
EXPECT_EQ(result.err, expected);
Expand Down

0 comments on commit 467e7a0

Please sign in to comment.