Add support for XEP-0100 jabber:iq:gateway
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user