Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

added test cases. #9

Merged
merged 3 commits into from

2 participants

@syo68k

No description provided.

@keitaf
Collaborator

Thank you for the pull request!

Can you remove the test case for "http://fe3.gamepot-testdb/"? twitter-text won't consider it as a valid URL because it doesn't have TLD (e.g., .com, .net, .uk, .jp etc).

@syo68k

test case for http://fe3.gamepot-testdb/ have been removed. Please confirm.

@keitaf
Collaborator

Thank you! One more request: Can you also add the same test case in autolink.yml? I just found out that twitter-text-js doesn't use extract.yml in its conformance test.

I'll merge this to master once twitter-text-rb and twitter-text-js are modified to pass this test case.

@syo68k

test case added to autolink.yml. Please Confirm.

@keitaf keitaf merged commit 0afbdd6 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 10 additions and 2 deletions.
  1. +5 −1 autolink.yml
  2. +5 −1 extract.yml
View
6 autolink.yml
@@ -1,4 +1,4 @@
-
+
tests:
usernames:
- description: "Autolink trailing username"
@@ -388,6 +388,10 @@ tests:
text: "text http://msdn.com/S(deadbeef)/page.htm"
expected: "text <a href=\"http://msdn.com/S(deadbeef)/page.htm\">http://msdn.com/S(deadbeef)/page.htm</a>"
+ - description: "Extract valid URL: http://msdn.microsoft.com/ja-jp/library/system.net.httpwebrequest(v=VS.100).aspx"
+ text: "text http://msdn.microsoft.com/ja-jp/library/system.net.httpwebrequest(v=VS.100).aspx"
+ expected: "text <a href=\"http://msdn.microsoft.com/ja-jp/library/system.net.httpwebrequest(v=VS.100).aspx\">text http://msdn.microsoft.com/ja-jp/library/system.net.httpwebrequest(v=VS.100).aspx</a>"
+
- description: "Autolink url with balanced parens hiding XSS"
text: 'text http://foo.com/("onclick="alert(1)")'
expected: 'text <a href="http://foo.com/">http://foo.com/</a>("onclick="alert(1)")'
View
6 extract.yml
@@ -1,4 +1,4 @@
-
+
tests:
mentions:
- description: "Extract mention at the begining of a tweet"
@@ -217,6 +217,10 @@ tests:
text: "text http://x.com/oneletterdomain"
expected: ["http://x.com/oneletterdomain"]
+ - description: "Extract valid URL: http://msdn.microsoft.com/ja-jp/library/system.net.httpwebrequest(v=VS.100).aspx"
+ text: "text http://msdn.microsoft.com/ja-jp/library/system.net.httpwebrequest(v=VS.100).aspx"
+ expected: ["http://msdn.microsoft.com/ja-jp/library/system.net.httpwebrequest(v=VS.100).aspx"]
+
- description: "DO NOT extract invalid URL: http://domain-begin_dash_2314352345_dfasd.foo-cow_4352.com"
text: "text http://domain-dash_2314352345_dfasd.foo-cow_4352.com"
expected: []
Something went wrong with that request. Please try again.