From 95ddd2e7da651fb86d7da95a885adaa6628cf533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Mangano?= Date: Wed, 2 Mar 2016 14:33:45 +0100 Subject: [PATCH] some more tests for Tags it needs to be a multimap --- tests/tags_test.cc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/tags_test.cc b/tests/tags_test.cc index ea8f50e..957167a 100644 --- a/tests/tags_test.cc +++ b/tests/tags_test.cc @@ -3,7 +3,7 @@ using namespace opustags; -TEST_CASE("Tag manipulation test") +TEST_CASE("Tag manipulation test", "[tags]") { SECTION("Basic operations") { Tags tags; @@ -39,4 +39,19 @@ TEST_CASE("Tag manipulation test") REQUIRE(std::get<0>(tags.get_all()[1]) == "y"); REQUIRE(std::get<0>(tags.get_all()[2]) == "gamma"); } + + SECTION("Key to multiple values") { + // ARTIST is set once per artist. + // https://www.xiph.org/vorbis/doc/v-comment.html + Tags tags; + tags.set("ARTIST", "You"); + tags.set("ARTIST", "Me"); + REQUIRE(tags.get_all().size() == 2); + } + + SECTION("Raw set") { + Tags tags; + tags.set("TITLE=Foo=Bar"); + REQUIRE(tags.get("TITLE") == "Foo=Bar"); + } }