From 249094d496e57904d2dbd92f4d76efcc3cfce374 Mon Sep 17 00:00:00 2001 From: Sascha Ochsenknecht Date: Fri, 20 Nov 2009 14:18:36 +0000 Subject: [PATCH] added test case, Fixes #2994 [SVN r57817] --- test/options_description_test.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/options_description_test.cpp b/test/options_description_test.cpp index 3470fd4..d05f366 100644 --- a/test/options_description_test.cpp +++ b/test/options_description_test.cpp @@ -155,6 +155,21 @@ void test_word_wrapping() ); } +void test_default_values() +{ + options_description desc("Supported options"); + desc.add_options() + ("maxlength", value()->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 @@ int main(int, char* []) test_formatting(); test_long_default_value(); test_word_wrapping(); + test_default_values(); return 0; } +