mirror of
https://github.com/fmang/opustags.git
synced 2025-03-14 08:30:08 +01:00
Handlers: removing nonexistent tag is not an error
This commit is contained in:
parent
7b616aa671
commit
8e9204420b
@ -27,7 +27,7 @@ bool RemovalTagsHandler::edit_impl(Tags &tags)
|
||||
return anything_removed;
|
||||
} else {
|
||||
if (!tags.contains(tag_key))
|
||||
throw TagDoesNotExistError(tag_key);
|
||||
return false;
|
||||
|
||||
tags.remove(tag_key);
|
||||
return true;
|
||||
|
@ -22,7 +22,7 @@ TEST_CASE("removal tags handler", "[tags_handlers]")
|
||||
REQUIRE(handler.edit(streamno, tags));
|
||||
REQUIRE(tags.get_all().size() == 1);
|
||||
REQUIRE(tags.contains(other_tag_key));
|
||||
REQUIRE_THROWS(handler.edit(streamno, tags));
|
||||
REQUIRE(!handler.edit(streamno, tags));
|
||||
}
|
||||
|
||||
SECTION("removing all tags")
|
||||
|
Loading…
x
Reference in New Issue
Block a user