diff --git a/test/linkify_test.exs b/test/linkify_test.exs index bdaffc1..164a34e 100644 --- a/test/linkify_test.exs +++ b/test/linkify_test.exs @@ -489,9 +489,49 @@ defmodule LinkifyTest do test "turn urls with schema into urls" do text = "📌https://google.com" + expected = "📌https://google.com" assert Linkify.link(text, rel: false) == expected + + text = "http://www.cs.vu.nl/~ast/intel/" + + expected = "http://www.cs.vu.nl/~ast/intel/" + + assert Linkify.link(text) == expected + + text = "https://forum.zdoom.org/viewtopic.php?f=44&t=57087" + + expected = + "https://forum.zdoom.org/viewtopic.php?f=44&t=57087" + + assert Linkify.link(text) == expected + + text = "https://en.wikipedia.org/wiki/Sophia_(Gnosticism)#Mythos_of_the_soul" + + expected = + "https://en.wikipedia.org/wiki/Sophia_(Gnosticism)#Mythos_of_the_soul" + + assert Linkify.link(text) == expected + + text = "https://en.wikipedia.org/wiki/Duff's_device" + + expected = + "https://en.wikipedia.org/wiki/Duff's_device" + + assert Linkify.link(text) == expected + + text = "https://1.1.1.1/" + + expected = "https://1.1.1.1/" + + assert Linkify.link(text) == expected + + text = "https://1.1.1.1:8080/" + + expected = "https://1.1.1.1:8080/" + + assert Linkify.link(text) == expected end test "strip prefix" do @@ -525,35 +565,10 @@ defmodule LinkifyTest do assert Linkify.link(text, new_window: true) == expected text = "@username" + expected = "@username" + assert Linkify.link(text, new_window: true) == expected - - text = "http://www.cs.vu.nl/~ast/intel/" - - expected = "http://www.cs.vu.nl/~ast/intel/" - - assert Linkify.link(text) == expected - - text = "https://forum.zdoom.org/viewtopic.php?f=44&t=57087" - - expected = - "https://forum.zdoom.org/viewtopic.php?f=44&t=57087" - - assert Linkify.link(text) == expected - - text = "https://en.wikipedia.org/wiki/Sophia_(Gnosticism)#Mythos_of_the_soul" - - expected = - "https://en.wikipedia.org/wiki/Sophia_(Gnosticism)#Mythos_of_the_soul" - - assert Linkify.link(text) == expected - - text = "https://en.wikipedia.org/wiki/Duff's_device" - - expected = - "https://en.wikipedia.org/wiki/Duff's_device" - - assert Linkify.link(text) == expected end end