Merge branch 'topic/mm-fixes' of git://208.110.73.182/silc into silc.1.1.branch
[silc.git] / lib / silcutil / tests / test_silcstrutil.c
index dd3354a64e5d5fad6dc2d9a5dd28031da0784ec7..0673199e3d328ae73af37d86f4c9325976872176 100644 (file)
@@ -1,6 +1,7 @@
 /* UTF-8 decoding tests */
+/* Other string util tests too */
 
-#include "silcincludes.h"
+#include "silc.h"
 
 #define utf8fail(n, data, len)                 \
 const unsigned char u##n[] = (data);           \
@@ -149,6 +150,18 @@ int main(int argc, char **argv)
   silc_free(s3);
   silc_free(s4);
 
+  /* Regex test */
+  SILC_LOG_DEBUG(("Simple regex test"));
+  s1 = "foo,bar,silc,com";
+  SILC_LOG_DEBUG(("Find 'silc' from %s", s1));
+  if (!silc_string_match(s1, "silc"))
+    goto err;
+  SILC_LOG_DEBUG(("Regex match"));
+  SILC_LOG_DEBUG(("Find 'foobar' from %s", s1));
+  if (silc_string_match(s1, "foobar"))
+    goto err;
+  SILC_LOG_DEBUG(("Regex not found (Ok)"));
+
   success = TRUE;
 
  err: