X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=mussa.git;a=blobdiff_plain;f=alg%2Ftest%2Ftest_annotations.cpp;h=970d516ee93613e1166be1ef2a701650b661aab8;hp=8bb0bea6407778ae365ecd61dc757a3f1dcd58e1;hb=5c3dc8c42679629c19ece07c0e63a53b1c69663f;hpb=6317e56b965b35eb20abbd3c383cba487908bf39 diff --git a/alg/test/test_annotations.cpp b/alg/test/test_annotations.cpp index 8bb0bea..970d516 100644 --- a/alg/test/test_annotations.cpp +++ b/alg/test/test_annotations.cpp @@ -53,6 +53,16 @@ BOOST_AUTO_TEST_CASE( annotations_get_metadata ) BOOST_CHECK_THROW( asp->get("not there"), annotations_key_error ); } + +BOOST_AUTO_TEST_CASE( annotations_getdefault_metadata ) +{ + boost::shared_ptr asp(new Annotations("asp")); + asp->set("header", "> amsp"); + + BOOST_CHECK_EQUAL( asp->size(), 2 ); + BOOST_CHECK_EQUAL( asp->getdefault("header", "foo"), "> amsp" ); + BOOST_CHECK_EQUAL( asp->getdefault("not there", "foo"), "foo" ); +} BOOST_AUTO_TEST_CASE( annotations_has_key ) { boost::shared_ptr asp(new Annotations("asp"));