]> git.proxmox.com Git - rustc.git/blob - vendor/pulldown-cmark/tests/suite/smart_punct.rs
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / vendor / pulldown-cmark / tests / suite / smart_punct.rs
1 // This file is auto-generated by the build script
2 // Please, do not modify it manually
3
4 use super::test_markdown_html;
5
6 #[test]
7 fn smart_punct_test_1() {
8 let original = r##""Hello," said the spider.
9 "'Shelob' is my name."
10 "##;
11 let expected = r##"<p>“Hello,” said the spider.
12 “‘Shelob’ is my name.”</p>
13 "##;
14
15 test_markdown_html(original, expected, true);
16 }
17
18 #[test]
19 fn smart_punct_test_2() {
20 let original = r##"'A', 'B', and 'C' are letters.
21 "##;
22 let expected = r##"<p>‘A’, ‘B’, and ‘C’ are letters.</p>
23 "##;
24
25 test_markdown_html(original, expected, true);
26 }
27
28 #[test]
29 fn smart_punct_test_3() {
30 let original = r##"'Oak,' 'elm,' and 'beech' are names of trees.
31 So is 'pine.'
32 "##;
33 let expected = r##"<p>‘Oak,’ ‘elm,’ and ‘beech’ are names of trees.
34 So is ‘pine.’</p>
35 "##;
36
37 test_markdown_html(original, expected, true);
38 }
39
40 #[test]
41 fn smart_punct_test_4() {
42 let original = r##"'He said, "I want to go."'
43 "##;
44 let expected = r##"<p>‘He said, “I want to go.”’</p>
45 "##;
46
47 test_markdown_html(original, expected, true);
48 }
49
50 #[test]
51 fn smart_punct_test_5() {
52 let original = r##"Were you alive in the 70's?
53 "##;
54 let expected = r##"<p>Were you alive in the 70’s?</p>
55 "##;
56
57 test_markdown_html(original, expected, true);
58 }
59
60 #[test]
61 fn smart_punct_test_6() {
62 let original = r##"Here is some quoted '`code`' and a "[quoted link](url)".
63 "##;
64 let expected = r##"<p>Here is some quoted ‘<code>code</code>’ and a “<a href="url">quoted link</a>”.</p>
65 "##;
66
67 test_markdown_html(original, expected, true);
68 }
69
70 #[test]
71 fn smart_punct_test_7() {
72 let original = r##"'tis the season to be 'jolly'
73 "##;
74 let expected = r##"<p>’tis the season to be ‘jolly’</p>
75 "##;
76
77 test_markdown_html(original, expected, true);
78 }
79
80 #[test]
81 fn smart_punct_test_8() {
82 let original = r##"'We'll use Jane's boat and John's truck,' Jenna said.
83 "##;
84 let expected = r##"<p>‘We’ll use Jane’s boat and John’s truck,’ Jenna said.</p>
85 "##;
86
87 test_markdown_html(original, expected, true);
88 }
89
90 #[test]
91 fn smart_punct_test_9() {
92 let original = r##""A paragraph with no closing quote.
93
94 "Second paragraph by same speaker, in fiction."
95 "##;
96 let expected = r##"<p>“A paragraph with no closing quote.</p>
97 <p>“Second paragraph by same speaker, in fiction.</p>
98 "##;
99
100 test_markdown_html(original, expected, true);
101 }
102
103 #[test]
104 fn smart_punct_test_10() {
105 let original = r##"[a]'s b'
106 "##;
107 let expected = r##"<p>[a]’s b’</p>
108 "##;
109
110 test_markdown_html(original, expected, true);
111 }
112
113 #[test]
114 fn smart_punct_test_11() {
115 let original = r##"\"This is not smart.\"
116 This isn\'t either.
117 5\'8\"
118 "##;
119 let expected = r##"<p>&quot;This is not smart.&quot;
120 This isn't either.
121 5'8&quot;</p>
122 "##;
123
124 test_markdown_html(original, expected, true);
125 }
126
127 #[test]
128 fn smart_punct_test_12() {
129 let original = r##"Some dashes: em---em
130 en--en
131 em --- em
132 en -- en
133 2--3
134 "##;
135 let expected = r##"<p>Some dashes: em—em
136 en–en
137 em — em
138 en – en
139 23</p>
140 "##;
141
142 test_markdown_html(original, expected, true);
143 }
144
145 #[test]
146 fn smart_punct_test_13() {
147 let original = r##"one-
148 two--
149 three---
150 four----
151 five-----
152 six------
153 seven-------
154 eight--------
155 nine---------
156 thirteen-------------.
157 "##;
158 let expected = r##"<p>one-
159 two–
160 three—
161 four––
162 five—–
163 six——
164 seven—––
165 eight––––
166 nine———
167 thirteen———––.</p>
168 "##;
169
170 test_markdown_html(original, expected, true);
171 }
172
173 #[test]
174 fn smart_punct_test_14() {
175 let original = r##"Escaped hyphens: \-- \-\-\-.
176 "##;
177 let expected = r##"<p>Escaped hyphens: -- ---.</p>
178 "##;
179
180 test_markdown_html(original, expected, true);
181 }
182
183 #[test]
184 fn smart_punct_test_15() {
185 let original = r##"Ellipses...and...and....
186 "##;
187 let expected = r##"<p>Ellipses…and…and….</p>
188 "##;
189
190 test_markdown_html(original, expected, true);
191 }
192
193 #[test]
194 fn smart_punct_test_16() {
195 let original = r##"No ellipses\.\.\.
196 "##;
197 let expected = r##"<p>No ellipses...</p>
198 "##;
199
200 test_markdown_html(original, expected, true);
201 }