|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r57817 - trunk/libs/program_options/test
From: s.ochsenknecht_at_[hidden]
Date: 2009-11-20 09:18:37
Author: s_ochsenknecht
Date: 2009-11-20 09:18:36 EST (Fri, 20 Nov 2009)
New Revision: 57817
URL: http://svn.boost.org/trac/boost/changeset/57817
Log:
added test case, Fixes #2994
Text files modified:
trunk/libs/program_options/test/options_description_test.cpp | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
Modified: trunk/libs/program_options/test/options_description_test.cpp
==============================================================================
--- trunk/libs/program_options/test/options_description_test.cpp (original)
+++ trunk/libs/program_options/test/options_description_test.cpp 2009-11-20 09:18:36 EST (Fri, 20 Nov 2009)
@@ -155,6 +155,21 @@
);
}
+void test_default_values()
+{
+ options_description desc("Supported options");
+ desc.add_options()
+ ("maxlength", value<double>()->default_value(.1, "0.1"), "Maximum edge length to keep.")
+ ;
+ stringstream ss;
+ ss << desc;
+ BOOST_CHECK_EQUAL(ss.str(),
+"Supported options:\n"
+" --maxlength arg (=0.1) Maximum edge length to keep.\n"
+ );
+}
+
+
int main(int, char* [])
{
test_type();
@@ -162,5 +177,7 @@
test_formatting();
test_long_default_value();
test_word_wrapping();
+ test_default_values();
return 0;
}
+
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk