mirror of
https://github.com/fmang/opustags.git
synced 2025-07-09 10:55:10 +02:00
allow inserting already present tags
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user