[gnome-terminal] screen: Add a few more URL regex unittests
- From: Egmont Koblinger <egmontkob src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-terminal] screen: Add a few more URL regex unittests
- Date: Fri, 26 Feb 2016 20:19:10 +0000 (UTC)
commit 7eee009b2fcd9ba65ae6d7e2dbdb4b561013d594
Author: Egmont Koblinger <egmont gmail com>
Date: Fri Feb 26 21:17:27 2016 +0100
screen: Add a few more URL regex unittests
https://bugzilla.redhat.com/show_bug.cgi?id=1310892
src/terminal-regex.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/terminal-regex.c b/src/terminal-regex.c
index b18b432..6b8bdb9 100644
--- a/src/terminal-regex.c
+++ b/src/terminal-regex.c
@@ -218,6 +218,9 @@ main (int argc, char **argv)
assert_match (REGEX_URL_AS_IS, "<http://foo.bar/asdf.qwer.html>",
"http://foo.bar/asdf.qwer.html");
assert_match (REGEX_URL_AS_IS, "Go to http://192.168.1.1.", "http://192.168.1.1");
assert_match (REGEX_URL_AS_IS, "If not, see <http://www.gnu.org/licenses/>.",
"http://www.gnu.org/licenses/");
+ assert_match (REGEX_URL_AS_IS, "<a href=\"http://foo/bar\">foo</a>", "http://foo/bar");
+ assert_match (REGEX_URL_AS_IS, "<a href='http://foo/bar'>foo</a>", "http://foo/bar");
+ assert_match (REGEX_URL_AS_IS, "<url>http://foo/bar</url>", "http://foo/bar");
assert_match (REGEX_URL_AS_IS, "http://", NULL);
assert_match (REGEX_URL_AS_IS, "http://a", ENTIRE);
@@ -293,6 +296,9 @@ main (int argc, char **argv)
assert_match (REGEX_EMAIL, "Write to foo [1 2 3 4]", "foo [1 2 3 4]");
assert_match (REGEX_EMAIL, "Write to foo [1 2 3 456]", NULL);
assert_match (REGEX_EMAIL, "Write to foo [1::2345]", "foo [1::2345]");
+ assert_match (REGEX_EMAIL, "<baz email=\"foo bar com\"/>", "foo bar com");
+ assert_match (REGEX_EMAIL, "<baz email='foo bar com'/>", "foo bar com");
+ assert_match (REGEX_EMAIL, "<email>foo bar com</email>", "foo bar com");
/* Sip, examples from rfc 3261 */
assert_match (REGEX_URL_VOIP, "sip:alice atlanta com;maddr=239.255.255.1;ttl=15", ENTIRE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]