Skip to content

Commit

Permalink
Test for the --help option
Browse files Browse the repository at this point in the history
  • Loading branch information
cameel committed Jul 1, 2021
1 parent a7cb9a5 commit efee406
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/solc/CommandLineParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,17 @@ BOOST_AUTO_TEST_CASE(no_options)
BOOST_TEST((parsedOptions.value() == expectedOptions));
}

BOOST_AUTO_TEST_CASE(help)
{
stringstream sout, serr;
optional<CommandLineOptions> parsedOptions = parseCommandLine({"solc", "--help"}, sout, serr);

BOOST_TEST(serr.str() == "");
BOOST_TEST(boost::starts_with(sout.str(), "solc, the Solidity commandline compiler."));
BOOST_TEST(sout.str().find("Usage: solc [options] [input_file...]") != string::npos);
BOOST_TEST(!parsedOptions.has_value());
}

BOOST_AUTO_TEST_CASE(cli_mode_options)
{
for (InputMode inputMode: {InputMode::Compiler, InputMode::CompilerWithASTImport})
Expand Down

0 comments on commit efee406

Please sign in to comment.