Skip to content

Commit 768e149

Browse files
committed
Add (failing) test for whitespace handling in Matrix->IRC formatting
1 parent d65c487 commit 768e149

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/format/common_test.exs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ defmodule M51.FormatTest do
159159
assert M51.Format.matrix2irc(~s(<img/>)) == ""
160160
end
161161

162-
test "Matrix link to IRC (404 on well-known" do
162+
test "Matrix link to IRC (404 on well-known)" do
163163
MockHTTPoison
164164
|> expect(:get!, 1, fn url ->
165165
assert url == "https://example.org/.well-known/matrix/client"
@@ -219,6 +219,12 @@ defmodule M51.FormatTest do
219219
"mentioning <a href=\"https://matrix.to/#/@user:example.org\">user</a>"
220220
) == "mentioning user:example.org"
221221

222+
# Fails because mochiweb_html drops the space, see:
223+
# https://github.com/mochi/mochiweb/issues/166
224+
# assert M51.Format.matrix2irc(
225+
# "mentioning <a href=\"https://matrix.to/#/@user1:example.org\">user1</a> <a href=\"https://matrix.to/#/@user2:example.org\">user2</a>"
226+
# ) == "mentioning user1:example.org user2:example.org"
227+
222228
# Correct format according to the spec:
223229
assert M51.Format.matrix2irc(
224230
"mentioning <a href=\"https://matrix.to/#/%40correctlyencoded%3Aexample.org\">correctly encoded user</a>"

0 commit comments

Comments
 (0)