X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fformatter_test.exs;h=c2b3d4ac055a06c965334b19390b9db465479f2b;hb=cdf5a668f2194d98ac2020babc4b10e4b01ab957;hp=4c65b26f2817f91b399c221a52226fcaf90e7cbf;hpb=6ff583e5e10e59fe76cb51ce3d04587307af9eae;p=akkoma
diff --git a/test/formatter_test.exs b/test/formatter_test.exs
index 4c65b26f2..c2b3d4ac0 100644
--- a/test/formatter_test.exs
+++ b/test/formatter_test.exs
@@ -23,21 +23,21 @@ defmodule Pleroma.FormatterTest do
text = "Hey, check out https://www.youtube.com/watch?v=8Zg1-TufF%20zY?x=1&y=2#blabla."
expected =
- "Hey, check out https://www.youtube.com/watch?v=8Zg1-TufF%20zY?x=1&y=2#blabla."
+ "Hey, check out https://www.youtube.com/watch?v=8Zg1-TufF%20zY?x=1&y=2#blabla."
assert Formatter.add_links({[], text}) |> Formatter.finalize() == expected
text = "https://mastodon.social/@lambadalambda"
expected =
- "https://mastodon.social/@lambadalambda"
+ "https://mastodon.social/@lambadalambda"
assert Formatter.add_links({[], text}) |> Formatter.finalize() == expected
text = "https://mastodon.social:4000/@lambadalambda"
expected =
- "https://mastodon.social:4000/@lambadalambda"
+ "https://mastodon.social:4000/@lambadalambda"
assert Formatter.add_links({[], text}) |> Formatter.finalize() == expected
@@ -47,28 +47,42 @@ defmodule Pleroma.FormatterTest do
assert Formatter.add_links({[], text}) |> Formatter.finalize() == expected
text = "http://www.cs.vu.nl/~ast/intel/"
- expected = "http://www.cs.vu.nl/~ast/intel/"
+ expected = "http://www.cs.vu.nl/~ast/intel/"
assert Formatter.add_links({[], text}) |> Formatter.finalize() == expected
text = "https://forum.zdoom.org/viewtopic.php?f=44&t=57087"
expected =
- "https://forum.zdoom.org/viewtopic.php?f=44&t=57087"
+ "https://forum.zdoom.org/viewtopic.php?f=44&t=57087"
assert Formatter.add_links({[], text}) |> Formatter.finalize() == 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"
+ "https://en.wikipedia.org/wiki/Sophia_(Gnosticism)#Mythos_of_the_soul"
assert Formatter.add_links({[], text}) |> Formatter.finalize() == expected
text = "https://www.google.co.jp/search?q=Nasim+Aghdam"
expected =
- "https://www.google.co.jp/search?q=Nasim+Aghdam"
+ "https://www.google.co.jp/search?q=Nasim+Aghdam"
+
+ assert Formatter.add_links({[], text}) |> Formatter.finalize() == expected
+
+ text = "https://en.wikipedia.org/wiki/Duff's_device"
+
+ expected =
+ "https://en.wikipedia.org/wiki/Duff's_device"
+
+ assert Formatter.add_links({[], text}) |> Formatter.finalize() == expected
+
+ text = "https://pleroma.com https://pleroma.com/sucks"
+
+ expected =
+ "https://pleroma.com https://pleroma.com/sucks"
assert Formatter.add_links({[], text}) |> Formatter.finalize() == expected
end
@@ -95,9 +109,9 @@ defmodule Pleroma.FormatterTest do
Enum.each(subs, fn {uuid, _} -> assert String.contains?(text, uuid) end)
expected_text =
- "@gsimg According to @gsimg According to @archaeme, that is @daggsy. Also hello @archaeme, that is @daggsy. Also hello @archaeme"