mirror of
https://github.com/fmang/opustags.git
synced 2025-03-14 08:30:08 +01:00
allow inserting already present tags
This commit is contained in:
parent
cd550d8d80
commit
a96cc9c222
@ -23,9 +23,6 @@ std::string InsertionTagsHandler::get_tag_value() const
|
||||
|
||||
bool InsertionTagsHandler::edit_impl(Tags &tags)
|
||||
{
|
||||
if (tags.contains(tag_key))
|
||||
throw TagAlreadyExistsError(tag_key);
|
||||
|
||||
tags.add(tag_key, tag_value);
|
||||
return true;
|
||||
}
|
||||
|
@ -15,5 +15,8 @@ TEST_CASE("insertion tags handler", "[tags_handlers]")
|
||||
REQUIRE(handler.edit(streamno, tags));
|
||||
REQUIRE(tags.get_all().size() == 1);
|
||||
REQUIRE(tags.get(expected_tag_key) == expected_tag_value);
|
||||
REQUIRE_THROWS(handler.edit(streamno, tags));
|
||||
|
||||
REQUIRE(handler.edit(streamno, tags));
|
||||
REQUIRE(tags.get_all().size() == 2);
|
||||
REQUIRE(tags.get(expected_tag_key) == expected_tag_value);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user