Skip to content

Commit

Permalink
Correct the other non-protocol autolink and extraction tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Sanford committed Dec 2, 2010
1 parent a1acf2c commit 36e0592
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 2 additions & 6 deletions autolink.yml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -196,10 +196,6 @@ tests:
text: "いまなにしてるhttp://example.comいまなにしてる" text: "いまなにしてるhttp://example.comいまなにしてる"
expected: "いまなにしてる<a href=\"http://example.com\">http://example.com</a>いまなにしてる" expected: "いまなにしてる<a href=\"http://example.com\">http://example.com</a>いまなにしてる"


- description: "Autolink URL without protocol in Japanese text"
text: "ABCあああDEF.com"
expected: "ABCあああ<a href=\"http://DEF.com\">DEF.com</a>"

- description: "Autolink url surrounded by parentheses does not capture them" - description: "Autolink url surrounded by parentheses does not capture them"
text: "text (http://example.com)" text: "text (http://example.com)"
expected: "text (<a href=\"http://example.com\">http://example.com</a>)" expected: "text (<a href=\"http://example.com\">http://example.com</a>)"
Expand Down Expand Up @@ -322,7 +318,7 @@ tests:


- description: "Autolink url containing ending with #value (not as url + hashtag)" - description: "Autolink url containing ending with #value (not as url + hashtag)"
text: "http://foo.com/?#foo" text: "http://foo.com/?#foo"
expected: "http://foo.com/?#foo" expected: "<a href=\"http://foo.com/?#foo\">http://foo.com/?#foo</a>"


- description: "DO NOT Autolink url without protocol (with www)" - description: "DO NOT Autolink url without protocol (with www)"
text: "www.example.biz" text: "www.example.biz"
Expand Down Expand Up @@ -402,7 +398,7 @@ tests:


- description: "Autolink URL should autolink a domain with a valid dash and a protocol" - description: "Autolink URL should autolink a domain with a valid dash and a protocol"
text: "Is http://www.foo-bar.com a valid URL?" text: "Is http://www.foo-bar.com a valid URL?"
expected: "Is <a href=\"http://www.foo-bar.com\">www.foo-bar.com</a> a valid URL?" expected: "Is <a href=\"http://www.foo-bar.com\">http://www.foo-bar.com</a> a valid URL?"


- description: "Autolink URL should link search urls (with &lang=, not &lang;)" - description: "Autolink URL should link search urls (with &lang=, not &lang;)"
text: "Check out http://search.twitter.com/search?q=avro&lang=en" text: "Check out http://search.twitter.com/search?q=avro&lang=en"
Expand Down
8 changes: 4 additions & 4 deletions extract.yml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -206,13 +206,13 @@ tests:
text: "text http://foo.com?#foo text" text: "text http://foo.com?#foo text"
expected: ["http://foo.com?#foo"] expected: ["http://foo.com?#foo"]


- description: "Extract URLs without protocol on (com|org|edu|gov|net) domains" - description: "SHOULD NOT Extract URLs without protocol on (com|org|edu|gov|net) domains"
text: "foo.com foo.net foo.org foo.edu foo.gov" text: "foo.com foo.net foo.org foo.edu foo.gov"
expected: ["http://foo.com", "http://foo.net", "http://foo.org", "http://foo.edu", "http://foo.gov"] expected: []


- description: "DO NOT extract URLs withour protocol not on (com|org|edu|gov|net) domains, unless preceded by www." - description: "DO NOT extract URLs withour protocol not on (com|org|edu|gov|net) domains, even when preceded by www."
text: "foo.bar foo.co.jp www.foo.bar www.foo.co.uk wwwww.foo foo.comm foo.somecom foo.govedu" text: "foo.bar foo.co.jp www.foo.bar www.foo.co.uk wwwww.foo foo.comm foo.somecom foo.govedu"
expected: ["http://www.foo.bar", "http://www.foo.co.uk"] expected: []


urls_with_indices: urls_with_indices:
- description: "Extract a URL" - description: "Extract a URL"
Expand Down

0 comments on commit 36e0592

Please sign in to comment.