@@ -13,7 +13,7 @@ void CppCommandLineTest::OptionDefaultCtor()
1313 QCOMPARE (option.description (), std::string ());
1414 QCOMPARE (option.isRequired (), false );
1515 QCOMPARE (option.defaultValue <std::string>(), std::string ());
16- QCOMPARE (option.boundValue <std::string>(), nullptr );
16+ QVERIFY (option.boundValue <std::string>() == nullptr );
1717}
1818
1919void CppCommandLineTest::OptionLongNameCtor ()
@@ -359,6 +359,7 @@ void CppCommandLineTest::parse()
359359 QCOMPARE (option, std::string (" file" ));
360360 QCOMPARE (another, 10 );
361361 QCOMPARE (positional, std::string (" somefile" ));
362+ QVERIFY (!parser.helpDisplayed ());
362363 }
363364}
364365
@@ -398,4 +399,17 @@ void CppCommandLineTest::parseFailed()
398399 }
399400}
400401
402+ void CppCommandLineTest::help ()
403+ {
404+
405+ {
406+ SCENARIO (" Unmatched required option" )
407+ std::vector<const char *> args{" ./app" , " -h" };
408+ cppcommandline::Parser parser;
409+ parser.parse (static_cast <int >(args.size ()), const_cast <char **>(args.data ()));
410+ QVERIFY (parser.helpDisplayed ());
411+ }
412+
413+ }
414+
401415QTEST_APPLESS_MAIN (CppCommandLineTest)
0 commit comments