X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=tests%2Fcommon%2Fircencodertest.cpp;h=dc6def70c74903568448440d3221e921b4a28bf7;hb=24c7de34254b5de4cf28045a6923a527e06f7290;hp=38b50e0e768d9a5e05ed6fa2509a4d41d2f12965;hpb=a95ad2de573027f9bee36db972bcae4195168d0c;p=quassel.git diff --git a/tests/common/ircencodertest.cpp b/tests/common/ircencodertest.cpp index 38b50e0e..dc6def70 100644 --- a/tests/common/ircencodertest.cpp +++ b/tests/common/ircencodertest.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2020 by the Quassel Project * + * Copyright (C) 2005-2022 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -208,6 +208,34 @@ TEST(IrcEncoderTest, tags_with_no_value_and_space_filled_trailing) {"bar", "baz", " "})).data()); } +TEST(IrcEncoderTest, tags_with_invalid_vendor) +{ + EXPECT_STRCASEEQ( + "@a=b foo", + write(IrcMessage( + {{IrcTagKey("a"), "b"}}, + "", + "foo")).data()); + EXPECT_STRCASEEQ( + "@example.com/a=b foo", + write(IrcMessage( + {{IrcTagKey("example.com", "a"), "b"}}, + "", + "foo")).data()); + EXPECT_STRCASEEQ( + "@example.com/subfolder/to/a=b foo", + write(IrcMessage( + {{IrcTagKey("example.com/subfolder/to", "a"), "b"}}, + "", + "foo")).data()); + EXPECT_STRCASEEQ( + "@v\\/e\\/n\\/d\\/o\\/r/tag=b foo", + write(IrcMessage( + {{IrcTagKey("v\\/e\\/n\\/d\\/o\\/r", "tag"), "b"}}, + "", + "foo")).data()); +} + TEST(IrcEncoderTest, tags_with_escaped_values) { std::vector expected{