summaryrefslogtreecommitdiff
path: root/tests/utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/utils.cpp')
-rw-r--r--tests/utils.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/utils.cpp b/tests/utils.cpp
index 6e3c32a..8691910 100644
--- a/tests/utils.cpp
+++ b/tests/utils.cpp
@@ -5,6 +5,7 @@
#include <utils/string.hpp>
#include <utils/split.hpp>
#include <utils/xdg.hpp>
+#include <utils/empty_if_fixed_server.hpp>
TEST_CASE("String split")
{
@@ -70,3 +71,20 @@ TEST_CASE("xdg_*_path")
CHECK(res == "/datadir/biboumi/bonjour.txt");
}
}
+
+TEST_CASE("empty if fixed irc server")
+{
+ GIVEN("A config with fixed_irc_server")
+ {
+ Config::set("fixed_irc_server", "irc.localhost");
+ THEN("our string is made empty")
+ CHECK(utils::empty_if_fixed_server("coucou coucou") == "");
+ }
+ GIVEN("A config with NO fixed_irc_server")
+ {
+ Config::set("fixed_irc_server", "");
+ THEN("our string is returned untouched")
+ CHECK(utils::empty_if_fixed_server("coucou coucou") == "coucou coucou");
+ }
+
+}