Add support for XEP-0100 jabber:iq:gateway

This commit is contained in:
Luca Matei Pintilie
2026-08-02 18:12:11 +02:00
parent ad14748a30
commit dbafe37e13
17 changed files with 323 additions and 5 deletions
+31
View File
@@ -0,0 +1,31 @@
#include <biboumi.h>
#include "catch2/catch_test_macros.hpp"
#include "catch2/generators/catch_generators.hpp"
#include <irc/irc_uri.hpp>
#include <optional>
#ifdef CURL_FOUND
TEST_CASE("URI") {
auto scheme = GENERATE("irc", "ircs");
auto i = GENERATE("%23channame", "%23channame,ischannel", "#channame",
"#channame,ischannel");
const std::string input =
std::string(scheme) + "://irc.example.com/" + std::string(i);
IrcUri uri(input);
CHECK(uri.get_server() == "irc.example.com");
CHECK(uri.get_entity() == "#channame");
}
#else
TEST_CASE("No CURL") {
auto scheme = GENERATE("irc", "ircs");
auto i = GENERATE("%23channame", "%23channame,ischannel", "#channame",
"#channame,ischannel");
const std::string input =
std::string(scheme) + "://irc.example.com/" + std::string(i);
IrcUri uri(input);
CHECK(uri.get_server() == std::nullopt);
CHECK(uri.get_entity() == std::nullopt);
}
#endif // CURL_FOUND