Skip to content

Commit 8a6e289

Browse files
committed
Update test skips
1 parent 6381c5c commit 8a6e289

File tree

3 files changed

+97
-81
lines changed

3 files changed

+97
-81
lines changed

tests/test_port/fixtures/normalize.md

Lines changed: 0 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -13,43 +13,6 @@ Encode link destination, decode text inside it:
1313
<p><a href="http://example.com/%CE%B1%CE%B2%CE%B3%CE%B4">foo</a></p>
1414
.
1515

16-
Should decode punycode:
17-
18-
.
19-
<http://xn--n3h.net/>
20-
.
21-
<p><a href="http://xn--n3h.net/">http://☃.net/</a></p>
22-
.
23-
24-
.
25-
<http://☃.net/>
26-
.
27-
<p><a href="http://xn--n3h.net/">http://☃.net/</a></p>
28-
.
29-
30-
Invalid punycode:
31-
32-
.
33-
<http://xn--xn.com/>
34-
.
35-
<p><a href="http://xn--xn.com/">http://xn--xn.com/</a></p>
36-
.
37-
38-
Invalid punycode (non-ascii):
39-
40-
.
41-
<http://xn--γ.com/>
42-
.
43-
<p><a href="http://xn--xn---emd.com/">http://xn--γ.com/</a></p>
44-
.
45-
46-
Two slashes should start a domain:
47-
48-
.
49-
[](//☃.net/)
50-
.
51-
<p><a href="//xn--n3h.net/"></a></p>
52-
.
5316

5417
Don't encode domains in unknown schemas:
5518

@@ -58,43 +21,3 @@ Don't encode domains in unknown schemas:
5821
.
5922
<p><a href="skype:%CE%B3%CE%B3%CE%B3"></a></p>
6023
.
61-
62-
Should auto-add protocol to autolinks:
63-
64-
.
65-
test google.com foo
66-
.
67-
<p>test <a href="http://google.com">google.com</a> foo</p>
68-
.
69-
70-
Should support IDN in autolinks:
71-
72-
.
73-
test http://xn--n3h.net/ foo
74-
.
75-
<p>test <a href="http://xn--n3h.net/">http://☃.net/</a> foo</p>
76-
.
77-
78-
.
79-
test http://☃.net/ foo
80-
.
81-
<p>test <a href="http://xn--n3h.net/">http://☃.net/</a> foo</p>
82-
.
83-
84-
.
85-
test //xn--n3h.net/ foo
86-
.
87-
<p>test <a href="//xn--n3h.net/">//☃.net/</a> foo</p>
88-
.
89-
90-
.
91-
test xn--n3h.net foo
92-
.
93-
<p>test <a href="http://xn--n3h.net">☃.net</a> foo</p>
94-
.
95-
96-
.
97-
98-
.
99-
<p>test <a href="mailto:[email protected]">xn--n3h@☃.net</a> foo</p>
100-
.

tests/test_port/fixtures/punycode.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
Should decode punycode:
2+
3+
.
4+
<http://xn--n3h.net/>
5+
.
6+
<p><a href="http://xn--n3h.net/">http://☃.net/</a></p>
7+
.
8+
9+
.
10+
<http://☃.net/>
11+
.
12+
<p><a href="http://xn--n3h.net/">http://☃.net/</a></p>
13+
.
14+
15+
Invalid punycode:
16+
17+
.
18+
<http://xn--xn.com/>
19+
.
20+
<p><a href="http://xn--xn.com/">http://xn--xn.com/</a></p>
21+
.
22+
23+
Invalid punycode (non-ascii):
24+
25+
.
26+
<http://xn--γ.com/>
27+
.
28+
<p><a href="http://xn--xn---emd.com/">http://xn--γ.com/</a></p>
29+
.
30+
31+
Two slashes should start a domain:
32+
33+
.
34+
[](//☃.net/)
35+
.
36+
<p><a href="//xn--n3h.net/"></a></p>
37+
.
38+
39+
Should auto-add protocol to autolinks:
40+
41+
.
42+
test google.com foo
43+
.
44+
<p>test <a href="http://google.com">google.com</a> foo</p>
45+
.
46+
47+
Should support IDN in autolinks:
48+
49+
.
50+
test http://xn--n3h.net/ foo
51+
.
52+
<p>test <a href="http://xn--n3h.net/">http://☃.net/</a> foo</p>
53+
.
54+
55+
.
56+
test http://☃.net/ foo
57+
.
58+
<p>test <a href="http://xn--n3h.net/">http://☃.net/</a> foo</p>
59+
.
60+
61+
.
62+
test //xn--n3h.net/ foo
63+
.
64+
<p>test <a href="//xn--n3h.net/">//☃.net/</a> foo</p>
65+
.
66+
67+
.
68+
test xn--n3h.net foo
69+
.
70+
<p>test <a href="http://xn--n3h.net">☃.net</a> foo</p>
71+
.
72+
73+
.
74+
75+
.
76+
<p>test <a href="mailto:[email protected]">xn--n3h@☃.net</a> foo</p>
77+
.

tests/test_port/test_fixtures.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,22 @@ def test_title(line, title, input, expected):
2323
)
2424
def test_commonmark_extras(line, title, input, expected):
2525
if line in [74, 88]:
26-
# TODO fix failing url escaping tests
27-
pytest.skip("url escaping")
26+
# TODO fix failing escaping tests
27+
# probably requires a fix of common.utils.stripEscape
28+
pytest.skip("escaping entities in link titles / fence.info")
29+
md = MarkdownIt("commonmark")
30+
md.options["langPrefix"] = ""
31+
text = md.render(input)
32+
if text.rstrip() != expected.rstrip():
33+
print(text)
34+
assert text.rstrip() == expected.rstrip()
35+
36+
37+
@pytest.mark.parametrize(
38+
"line,title,input,expected",
39+
read_fixture_file(FIXTURE_PATH.joinpath("normalize.md")),
40+
)
41+
def test_normalize_url(line, title, input, expected):
2842
md = MarkdownIt("commonmark")
2943
text = md.render(input)
3044
assert text.rstrip() == expected.rstrip()
@@ -34,11 +48,13 @@ def test_commonmark_extras(line, title, input, expected):
3448
"line,title,input,expected", read_fixture_file(FIXTURE_PATH.joinpath("fatal.md"))
3549
)
3650
def test_fatal(line, title, input, expected):
37-
if line in [1, 17, 25]:
51+
if line in [1, 25]:
3852
# TODO fix failing url escaping tests
39-
pytest.skip("url escaping")
53+
pytest.skip("url normalisation")
4054
md = MarkdownIt("commonmark")
4155
text = md.render(input)
56+
if text.rstrip() != expected.rstrip():
57+
print(text)
4258
assert text.rstrip() == expected.rstrip()
4359

4460

0 commit comments

Comments
 (0)