[smuxi: 57/111] Engine(-Tests): fixed matching some odd URLs



commit 873ea7e949f8d19a259df196bc2f650dfb710b0c
Author: Mirco Bauer <meebey meebey net>
Date:   Fri Jan 10 21:14:04 2014 +0100

    Engine(-Tests): fixed matching some odd URLs

 src/Engine-Tests/MessageBuilderTests.cs     |   36 ++++++++++++++++++++++++++-
 src/Engine/Config/MessageBuilderSettings.cs |    2 +-
 2 files changed, 36 insertions(+), 2 deletions(-)
---
diff --git a/src/Engine-Tests/MessageBuilderTests.cs b/src/Engine-Tests/MessageBuilderTests.cs
index 2df06fd..4983738 100644
--- a/src/Engine-Tests/MessageBuilderTests.cs
+++ b/src/Engine-Tests/MessageBuilderTests.cs
@@ -1,6 +1,6 @@
 // Smuxi - Smart MUltipleXed Irc
 //
-// Copyright (c) 2013 Mirco Bauer <meebey meebey net>
+// Copyright (c) 2013-2014 Mirco Bauer <meebey meebey net>
 //
 // Full GPL License: <http://www.gnu.org/licenses/gpl.txt>
 // 
@@ -493,6 +493,40 @@ namespace Smuxi.Engine
         }
 
         [Test]
+        public void AppendMessageWithOddUrls()
+        {
+            var msg = @"zack: 
http://anonscm.debian.org/gitweb/?p=lintian/lintian.git;a=blob;f=checks/source-copyright.desc;h=3276a57e81b1c8c38073e667221e262df1a606c0;hb=167170d7911473a726f7e77008d8b2246a6822e8";;
+            var builder = new MessageBuilder();
+            builder.TimeStamp = DateTime.MinValue;
+            builder.Append(new TextMessagePartModel("zack: "));
+            builder.Append(new 
UrlMessagePartModel("http://anonscm.debian.org/gitweb/?p=lintian/lintian.git;a=blob;f=checks/source-copyright.desc;h=3276a57e81b1c8c38073e667221e262df1a606c0;hb=167170d7911473a726f7e77008d8b2246a6822e8";));
+            TestMessage(msg, builder.ToMessage());
+
+            msg = 
"http://sources.debian.net/src/kfreebsd-10/10.0~svn259778-1/sys/cddl/dev/dtrace/dtrace_anon.c";;
+            builder = new MessageBuilder();
+            builder.TimeStamp = DateTime.MinValue;
+            builder.Append(new 
UrlMessagePartModel("http://sources.debian.net/src/kfreebsd-10/10.0~svn259778-1/sys/cddl/dev/dtrace/dtrace_anon.c";));
+            TestMessage(msg, builder.ToMessage());
+
+            msg = "http://www.stack.nl/~jilles/cgi-bin/hgwebdir.cgi/charybdis/raw-rev/9d769851c1c7";;
+            builder = new MessageBuilder();
+            builder.TimeStamp = DateTime.MinValue;
+            builder.Append(new 
UrlMessagePartModel("http://www.stack.nl/~jilles/cgi-bin/hgwebdir.cgi/charybdis/raw-rev/9d769851c1c7";));
+            TestMessage(msg, builder.ToMessage());
+        }
+
+        [Test]
+        [Ignore]
+        public void BrokenAppendMessageWithOddUrls()
+        {
+            var msg = "https://web.archive.org/web/20050208144213/http://www.jaganelli.de/";;
+            var builder = new MessageBuilder();
+            builder.TimeStamp = DateTime.MinValue;
+            builder.Append(new 
UrlMessagePartModel("https://web.archive.org/web/20050208144213/http://www.jaganelli.de/";));
+            TestMessage(msg, builder.ToMessage());
+        }
+
+        [Test]
         public void AppendBrokenMail()
         {
             var msg = "mailto:/larry google com";
diff --git a/src/Engine/Config/MessageBuilderSettings.cs b/src/Engine/Config/MessageBuilderSettings.cs
index 408fdfc..8e8056d 100644
--- a/src/Engine/Config/MessageBuilderSettings.cs
+++ b/src/Engine/Config/MessageBuilderSettings.cs
@@ -54,7 +54,7 @@ namespace Smuxi.Engine
 
         void InitDefaultLinks()
         {
-            string path_last_chars = @"a-zA-Z0-9#/%&=\-_+";
+            string path_last_chars = @"a-zA-Z0-9#/%&=\-_+;~";
             string path_chars = path_last_chars + @")(?.,";
             string domainchars = @"[a-z0-9\-]+";
             string subdomain = domainchars + @"\.";


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]