From 9925f4514ef8a2421f76c86ba465d9163e7b67ca Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Thu, 19 Nov 2020 19:49:21 +0000 Subject: [PATCH] Add .onion domain tests --- test/linkify_test.exs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/test/linkify_test.exs b/test/linkify_test.exs index 3d9bf55..9e94437 100644 --- a/test/linkify_test.exs +++ b/test/linkify_test.exs @@ -406,6 +406,15 @@ defmodule LinkifyTest do assert Linkify.link(text, mention: true, mention_prefix: "/users/") == expected end + + test ".onion domain" do + text = "Hey @admin@vww6ybal4bd7szmgncyruucpgfkqahzddi37ktceo3ah7ngmcopnpyyd.onion" + + expected = + "Hey @admin@vww6ybal4bd7szmgncyruucpgfkqahzddi37ktceo3ah7ngmcopnpyyd.onion" + + assert Linkify.link(text, mention: true, mention_prefix: "/users/") == expected + end end describe "hashtag links" do @@ -713,7 +722,8 @@ defmodule LinkifyTest do text = "I looked at theonion.com; it was no longer funny." - expected = "I looked at theonion.com; it was no longer funny." + expected = + "I looked at theonion.com; it was no longer funny." assert Linkify.link(text) == expected end @@ -732,5 +742,15 @@ defmodule LinkifyTest do assert Linkify.link(text) == expected end + + test ".onion domain" do + text = + "The riseup.net hidden service is at vww6ybal4bd7szmgncyruucpgfkqahzddi37ktceo3ah7ngmcopnpyyd.onion" + + expected = + "The riseup.net hidden service is at vww6ybal4bd7szmgncyruucpgfkqahzddi37ktceo3ah7ngmcopnpyyd.onion" + + assert Linkify.link(text) == expected + end end end