From b5bc8b4fcb0f86ed587bfdb7f4d69f37ddc933a7 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 6 May 2005 08:12:27 +0000 Subject: [PATCH] Add test for unregisted options. [SVN r28691] --- test/cmdline_test.cpp | 79 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/test/cmdline_test.cpp b/test/cmdline_test.cpp index e8eda74..16a6828 100644 --- a/test/cmdline_test.cpp +++ b/test/cmdline_test.cpp @@ -522,6 +522,84 @@ void test_style_parser() BOOST_CHECK_EQUAL(result[1].value[0], "1"); } +void test_unregistered() +{ + // Check unregisted option when no options are registed at all. + options_description desc; + + vector input; + input.push_back("--foo=1"); + input.push_back("--bar"); + input.push_back("1"); + input.push_back("-b"); + input.push_back("-biz"); + + detail::cmdline cmd(input); + cmd.set_options_description(desc); + cmd.allow_unregistered(); + + vector