summaryrefslogtreecommitdiff
path: root/src/test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test.cpp')
-rw-r--r--src/test.cpp31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/test.cpp b/src/test.cpp
index 9cb48b7..aa1ccde 100644
--- a/src/test.cpp
+++ b/src/test.cpp
@@ -2,18 +2,18 @@
* Just a very simple test suite, by hand, using assert()
*/
-#include <assert.h>
-
-#include <iostream>
-
-#include <bridge/colors.hpp>
+#include <xmpp/xmpp_parser.hpp>
#include <utils/encoding.hpp>
+#include <config/config.hpp>
+#include <bridge/colors.hpp>
+#include <utils/split.hpp>
+#include <xmpp/jid.hpp>
#include <string.h>
-#include <config/config.hpp>
+#include <iostream>
+#include <vector>
-#include <xmpp/jid.hpp>
-#include <xmpp/xmpp_parser.hpp>
+#include <assert.h>
int main()
{
@@ -49,6 +49,21 @@ int main()
assert(coucou == "COUCOU");
/**
+ * Utils
+ */
+ std::vector<std::string> splitted = utils::split("a::a", ':', false);
+ assert(splitted.size() == 2);
+ splitted = utils::split("a::a", ':', true);
+ assert(splitted.size() == 3);
+ assert(splitted[0] == "a");
+ assert(splitted[1] == "");
+ assert(splitted[2] == "a");
+ splitted = utils::split("\na", '\n', true);
+ assert(splitted.size() == 2);
+ assert(splitted[0] == "");
+ assert(splitted[1] == "a");
+
+ /**
* XML parsing
*/
XmppParser xml;