]> git.proxmox.com Git - rustc.git/blob - vendor/pulldown-cmark/tests/suite/regression.rs
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / vendor / pulldown-cmark / tests / suite / regression.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 regression_test_1() {
8 let original = r##"<details><summary>Testing 1..2..3..</summary>
9
10 This is a test of the details element.
11
12 </details>
13 "##;
14 let expected = r##"<details><summary>Testing 1..2..3..</summary>
15 <p>This is a test of the details element.</p>
16 </details>
17 "##;
18
19 test_markdown_html(original, expected, false);
20 }
21
22 #[test]
23 fn regression_test_2() {
24 let original = r##"see the [many] [articles] [on] [QuickCheck].
25
26 [many]: https://medium.com/@jlouis666/quickcheck-advice-c357efb4e7e6
27 [articles]: http://www.quviq.com/products/erlang-quickcheck/
28 [on]: https://wiki.haskell.org/Introduction_to_QuickCheck1
29 [QuickCheck]: https://hackage.haskell.org/package/QuickCheck
30 "##;
31 let expected = r##"<p>see the
32 <a href="https://medium.com/@jlouis666/quickcheck-advice-c357efb4e7e6">many</a>
33 <a href="http://www.quviq.com/products/erlang-quickcheck/">articles</a>
34 <a href="https://wiki.haskell.org/Introduction_to_QuickCheck1">on</a>
35 <a href="https://hackage.haskell.org/package/QuickCheck">QuickCheck</a>.
36 </p>
37 "##;
38
39 test_markdown_html(original, expected, false);
40 }
41
42 #[test]
43 fn regression_test_3() {
44 let original = r##"[![debug-stub-derive on crates.io][cratesio-image]][cratesio]
45 [![debug-stub-derive on docs.rs][docsrs-image]][docsrs]
46
47 [cratesio-image]: https://img.shields.io/crates/v/debug_stub_derive.svg
48 [cratesio]: https://crates.io/crates/debug_stub_derive
49 [docsrs-image]: https://docs.rs/debug_stub_derive/badge.svg?version=0.3.0
50 [docsrs]: https://docs.rs/debug_stub_derive/0.3.0/
51 "##;
52 let expected = r##"<p><a href="https://crates.io/crates/debug_stub_derive"><img src="https://img.shields.io/crates/v/debug_stub_derive.svg" alt="debug-stub-derive on crates.io" /></a>
53 <a href="https://docs.rs/debug_stub_derive/0.3.0/"><img src="https://docs.rs/debug_stub_derive/badge.svg?version=0.3.0" alt="debug-stub-derive on docs.rs" /></a></p>
54 "##;
55
56 test_markdown_html(original, expected, false);
57 }
58
59 #[test]
60 fn regression_test_4() {
61 let original = r##"| Title A | Title B |
62 | --------- | --------- |
63 | Content | Content |
64
65 | Title A | Title B | Title C | Title D |
66 | --------- | --------- | --------- | ---------:|
67 | Content | Content | Conent | Content |
68 "##;
69 let expected = r##"<table><thead><tr><th>Title A </th><th>Title B </th></tr></thead><tbody>
70 <tr><td>Content </td><td>Content </td></tr>
71 </tbody></table>
72 <table><thead><tr><th>Title A </th><th>Title B </th><th>Title C </th><th align="right">Title D </th></tr></thead><tbody>
73 <tr><td>Content </td><td>Content </td><td>Conent </td><td align="right">Content </td></tr>
74 </tbody></table>
75 "##;
76
77 test_markdown_html(original, expected, false);
78 }
79
80 #[test]
81 fn regression_test_5() {
82 let original = r##"foo§__(bar)__
83 "##;
84 let expected = r##"<p>foo§<strong>(bar)</strong></p>
85 "##;
86
87 test_markdown_html(original, expected, false);
88 }
89
90 #[test]
91 fn regression_test_6() {
92 let original = r##"<https://example.com> hello
93 "##;
94 let expected = r##"<p><a href="https://example.com">https://example.com</a> hello</p>
95
96 "##;
97
98 test_markdown_html(original, expected, false);
99 }
100
101 #[test]
102 fn regression_test_7() {
103 let original = r##"[foo][bar]
104
105 <!-- foo -->
106 [bar]: a
107 "##;
108 let expected = r##"<p><a href="a">foo</a></p>
109 <!-- foo -->
110 "##;
111
112 test_markdown_html(original, expected, false);
113 }
114
115 #[test]
116 fn regression_test_8() {
117 let original = r##"<!-- <dl> -->
118 - **foo** (u8, u8)
119
120 make something
121
122 - **bar** (u16, u16)
123
124 make something
125 "##;
126 let expected = r##"<!-- <dl> -->
127 <ul>
128 <li>
129 <p><strong>foo</strong> (u8, u8)</p>
130 <p>make something</p>
131 </li>
132 <li>
133 <p><strong>bar</strong> (u16, u16)</p>
134 <p>make something</p>
135 </li>
136 </ul>
137
138 "##;
139
140 test_markdown_html(original, expected, false);
141 }
142
143 #[test]
144 fn regression_test_9() {
145 let original = r##"[`
146 i8
147 `](
148 ../../../std/primitive.i8.html
149 )
150 "##;
151 let expected = r##"<p><a href="../../../std/primitive.i8.html"><code>i8</code></a></p>
152 "##;
153
154 test_markdown_html(original, expected, false);
155 }
156
157 #[test]
158 fn regression_test_10() {
159 let original = r##"[a]
160
161 [a]: /url (title\\*)
162 "##;
163 let expected = r##"<p><a href="/url" title="title\*">a</a></p>
164 "##;
165
166 test_markdown_html(original, expected, false);
167 }
168
169 #[test]
170 fn regression_test_11() {
171 let original = r##"[a]
172
173 [a]: /url (title\))
174 "##;
175 let expected = r##"<p><a href="/url" title="title)">a</a></p>
176 "##;
177
178 test_markdown_html(original, expected, false);
179 }
180
181 #[test]
182 fn regression_test_12() {
183 let original = r##"[a]
184
185 [a]: /url (title))
186 "##;
187 let expected = r##"<p>[a]</p>
188 <p>[a]: /url (title))</p>
189 "##;
190
191 test_markdown_html(original, expected, false);
192 }
193
194 #[test]
195 fn regression_test_13() {
196 let original = r##"a <?php this is not a valid processing tag
197 ---
198 b <?php but this is ?>
199 "##;
200 let expected = r##"<h2>a &lt;?php this is not a valid processing tag</h2>
201 <p>b <?php but this is ?></p>
202 "##;
203
204 test_markdown_html(original, expected, false);
205 }
206
207 #[test]
208 fn regression_test_14() {
209 let original = r##"[a]: u\
210 foo
211 "##;
212 let expected = r##"<p>foo</p>
213 "##;
214
215 test_markdown_html(original, expected, false);
216 }
217
218 #[test]
219 fn regression_test_15() {
220 let original = r##"\`foo`
221 "##;
222 let expected = r##"<p>`foo`</p>
223 "##;
224
225 test_markdown_html(original, expected, false);
226 }
227
228 #[test]
229 fn regression_test_16() {
230 let original = r##"foo\\
231 bar
232 "##;
233 let expected = r##"<p>foo\
234 bar</p>
235 "##;
236
237 test_markdown_html(original, expected, false);
238 }
239
240 #[test]
241 fn regression_test_17() {
242 let original = r##"1\. foo
243
244 1\) bar
245 "##;
246 let expected = r##"<p>1. foo</p>
247 <p>1) bar</p>
248 "##;
249
250 test_markdown_html(original, expected, false);
251 }
252
253 #[test]
254 fn regression_test_18() {
255 let original = r##"1...
256
257 1.2.3.
258
259 1 2 3 .
260
261 1.|2.-3.
262
263 1)2)3)
264 "##;
265 let expected = r##"<p>1...</p>
266 <p>1.2.3.</p>
267 <p>1 2 3 .</p>
268 <p>1.|2.-3.</p>
269 <p>1)2)3)</p>
270 "##;
271
272 test_markdown_html(original, expected, false);
273 }
274
275 #[test]
276 fn regression_test_19() {
277 let original = r##"[](<<>)
278 "##;
279 let expected = r##"<p>[](&lt;&lt;&gt;)</p>
280 "##;
281
282 test_markdown_html(original, expected, false);
283 }
284
285 #[test]
286 fn regression_test_20() {
287 let original = r##"\``foo``bar`
288 "##;
289 let expected = r##"<p>`<code>foo``bar</code></p>
290 "##;
291
292 test_markdown_html(original, expected, false);
293 }
294
295 #[test]
296 fn regression_test_21() {
297 let original = r##"\\`foo`
298 "##;
299 let expected = r##"<p>\<code>foo</code></p>
300 "##;
301
302 test_markdown_html(original, expected, false);
303 }
304
305 #[test]
306 fn regression_test_22() {
307 let original = r##"[\\]: x
308
309 YOLO
310 "##;
311 let expected = r##"<p>YOLO</p>
312 "##;
313
314 test_markdown_html(original, expected, false);
315 }
316
317 #[test]
318 fn regression_test_23() {
319 let original = r##"lorem ipsum
320 A | B
321 ---|---
322 foo | bar
323 "##;
324 let expected = r##"<p>lorem ipsum
325 A | B
326 ---|---
327 foo | bar</p>
328 "##;
329
330 test_markdown_html(original, expected, false);
331 }
332
333 #[test]
334 fn regression_test_24() {
335 let original = r##"foo|bar
336 ---|---
337 foo|bar
338 "##;
339 let expected = r##"<table><thead><tr><th>foo</th><th>bar</th></tr></thead>
340 <tbody><tr><td>foo</td><td>bar</td></tr></tbody>
341 </table>
342 "##;
343
344 test_markdown_html(original, expected, false);
345 }
346
347 #[test]
348 fn regression_test_25() {
349 let original = r##"foo|bar\\
350 ---|---
351 foo|bar
352 "##;
353 let expected = r##"<table><thead><tr><th>foo</th><th>bar\</th></tr></thead>
354 <tbody><tr><td>foo</td><td>bar</td></tr></tbody>
355 </table>
356 "##;
357
358 test_markdown_html(original, expected, false);
359 }
360
361 #[test]
362 fn regression_test_26() {
363 let original = r##"[<foo>](url)
364 "##;
365 let expected = r##"<p><a href="url"><foo></a></p>
366 "##;
367
368 test_markdown_html(original, expected, false);
369 }
370
371 #[test]
372 fn regression_test_27() {
373 let original = r##"[<foo>bar</foo>](url)
374 "##;
375 let expected = r##"<p><a href="url"><foo>bar</foo></a></p>
376 "##;
377
378 test_markdown_html(original, expected, false);
379 }
380
381 #[test]
382 fn regression_test_28() {
383 let original = r##"![<http://example.com>](http://example.com/logo.png)
384 "##;
385 let expected = r##"<p><img alt="http://example.com" src="http://example.com/logo.png"></p>
386 "##;
387
388 test_markdown_html(original, expected, false);
389 }
390
391 #[test]
392 fn regression_test_29() {
393 let original = r##"[<http://one> <http://two>](url)
394 "##;
395 let expected = r##"<p><a href="url"></a><a href="http://one">http://one</a> <a href="http://two">http://two</a></p>
396 "##;
397
398 test_markdown_html(original, expected, false);
399 }
400
401 #[test]
402 fn regression_test_30() {
403 let original = r##"Markdown | Less | Pretty
404 --- | --- | ---
405
406 some text
407 "##;
408 let expected = r##"<table><thead><tr><th>Markdown </th><th> Less </th><th> Pretty</th></tr></thead><tbody>
409 </tbody></table>
410 <p>some text</p>
411 "##;
412
413 test_markdown_html(original, expected, false);
414 }
415
416 #[test]
417 fn regression_test_31() {
418 let original = r##"1. > foo
419 2. >
420 "##;
421 let expected = r##"<ol>
422 <li>
423 <blockquote>
424 <p>foo</p>
425 </blockquote>
426 </li>
427 <li>
428 <blockquote>
429 </blockquote>
430 </li>
431 </ol>
432 "##;
433
434 test_markdown_html(original, expected, false);
435 }
436
437 #[test]
438 fn regression_test_32() {
439 let original = r##"[
440 x
441
442 ]: f
443 "##;
444 let expected = r##"<p>[
445 x</p>
446 <p>]: f</p>
447 "##;
448
449 test_markdown_html(original, expected, false);
450 }
451
452 #[test]
453 fn regression_test_33() {
454 let original = r##"[foo]:
455 "##;
456 let expected = r##"<p>[foo]:</p>
457 "##;
458
459 test_markdown_html(original, expected, false);
460 }
461
462 #[test]
463 fn regression_test_34() {
464 let original = r##"> [foo
465 > bar]: /url
466 >
467 > [foo bar]
468 "##;
469 let expected = r##"<blockquote>
470 <p><a href="/url">foo bar</a></p>
471 </blockquote>
472 "##;
473
474 test_markdown_html(original, expected, false);
475 }
476
477 #[test]
478 fn regression_test_35() {
479 let original = r##"> foo | bar
480 > --- | ---
481 yolo | swag
482 "##;
483 let expected = r##"<blockquote>
484 <table><thead><tr><th>foo</th><th>bar</th></tr></thead></table>
485 </blockquote>
486 <p>yolo | swag</p>
487 "##;
488
489 test_markdown_html(original, expected, false);
490 }
491
492 #[test]
493 fn regression_test_36() {
494 let original = r##"<foo bar>
495 "##;
496 let expected = r##"<foo bar>
497 "##;
498
499 test_markdown_html(original, expected, false);
500 }
501
502 #[test]
503 fn regression_test_37() {
504 let original = r##"<foo bar =
505 "hi">
506 "##;
507 let expected = r##"<p><foo bar =
508 "hi"> </p>
509 "##;
510
511 test_markdown_html(original, expected, false);
512 }
513
514 #[test]
515 fn regression_test_38() {
516 let original = r##"~~*_**__
517
518 __a__
519 "##;
520 let expected = r##"<p>~~*_**__</p>
521 <p><strong>a</strong></p>
522 "##;
523
524 test_markdown_html(original, expected, false);
525 }
526
527 #[test]
528 fn regression_test_39() {
529 let original = r##"> `
530 > `
531 "##;
532 let expected = r##"<blockquote>
533 <p><code></code></p>
534 </blockquote>
535 "##;
536
537 test_markdown_html(original, expected, false);
538 }
539
540 #[test]
541 fn regression_test_40() {
542 let original = r##"`\|`
543 "##;
544 let expected = r##"<p><code>\|</code></p>
545 "##;
546
547 test_markdown_html(original, expected, false);
548 }
549
550 #[test]
551 fn regression_test_41() {
552 let original = r##"Paragraph 1
553
554 Paragraph 2
555 "##;
556 let expected = r##"<p>Paragraph 1</p>
557 <p>Paragraph 2</p>
558 "##;
559
560 test_markdown_html(original, expected, false);
561 }
562
563 #[test]
564 fn regression_test_42() {
565 let original = r##"\[[link text](https://www.google.com/)\]
566 "##;
567 let expected = r##"<p>[<a href="https://www.google.com/">link text</a>]</p>
568 "##;
569
570 test_markdown_html(original, expected, false);
571 }
572
573 #[test]
574 fn regression_test_43() {
575 let original = r##"foo | bar
576 --- | ---
577 [a](< | url>)
578 "##;
579 let expected = r##"<table><thead><tr><th>foo</th><th>bar</th></tr></thead><tbody><tr><td>[a](&lt;</td><td>url&gt;)</td></tr></tbody></table>
580 "##;
581
582 test_markdown_html(original, expected, false);
583 }
584
585 #[test]
586 fn regression_test_44() {
587 let original = r##"[a](url "
588 - - -
589 ")
590 "##;
591 let expected = r##"<p>[a](url "</p>
592 <hr>
593 <p>")</p>
594 "##;
595
596 test_markdown_html(original, expected, false);
597 }
598
599 #[test]
600 fn regression_test_45() {
601 let original = r##"[a](url
602
603 )
604 "##;
605 let expected = r##"<p>[a](url</p>
606 <p>)</p>
607 "##;
608
609 test_markdown_html(original, expected, false);
610 }
611
612 #[test]
613 fn regression_test_46() {
614 let original = r##"[a](b "
615
616 ")
617 "##;
618 let expected = r##"<p>[a](b &quot;</p>
619 <p>&quot;)</p>
620 "##;
621
622 test_markdown_html(original, expected, false);
623 }
624
625 #[test]
626 fn regression_test_47() {
627 let original = r##"<http:// >
628 "##;
629 let expected = r##"<p>&lt;http:// &gt;</p>
630 "##;
631
632 test_markdown_html(original, expected, false);
633 }
634
635 #[test]
636 fn regression_test_48() {
637 let original = r##"<http://\a>
638 "##;
639 let expected = r##"<p>&lt;http://\a&gt;</p>
640 "##;
641
642 test_markdown_html(original, expected, false);
643 }
644
645 #[test]
646 fn regression_test_49() {
647 let original = r##"foo | bar
648 --- | ---
649 <http://| baz
650 "##;
651 let expected = r##"<table>
652 <thead>
653 <tr><th>foo</th><th>bar</th></tr>
654 </thead>
655 <tbody>
656 <tr><td>&lt;http://</td><td>baz</td></tr>
657 </tbody>
658 </table>
659 "##;
660
661 test_markdown_html(original, expected, false);
662 }
663
664 #[test]
665 fn regression_test_50() {
666 let original = r##"foo | bar
667 --- | ---
668 <http://|>
669 "##;
670 let expected = r##"<table>
671 <thead>
672 <tr><th>foo</th><th>bar</th></tr>
673 </thead>
674 <tbody>
675 <tr><td>&lt;http://</td><td>&gt;</td></tr>
676 </tbody>
677 </table>
678 "##;
679
680 test_markdown_html(original, expected, false);
681 }
682
683 #[test]
684 fn regression_test_51() {
685 let original = r##"<sup>\*hi</sup>\_
686 "##;
687 let expected = r##"<p><sup>*hi</sup>_</p>
688 "##;
689
690 test_markdown_html(original, expected, false);
691 }
692
693 #[test]
694 fn regression_test_52() {
695 let original = r##"email: <john@example.com>\_
696 "##;
697 let expected = r##"<p>email: <a href="mailto:john@example.com">john@example.com</a>_</p>
698 "##;
699
700 test_markdown_html(original, expected, false);
701 }
702
703 #[test]
704 fn regression_test_53() {
705 let original = r##"> [link](/url 'foo
706 > bar')
707 "##;
708 let expected = r##"<blockquote>
709 <p><a href="/url" title="foo
710 bar">link</a></p>
711 </blockquote>
712 "##;
713
714 test_markdown_html(original, expected, false);
715 }
716
717 #[test]
718 fn regression_test_54() {
719 let original = r##"> [foo
720 > bar]: /url
721 >
722 > [foo bar]
723 "##;
724 let expected = r##"<blockquote>
725 <p><a href="/url">foo bar</a></p>
726 </blockquote>
727 "##;
728
729 test_markdown_html(original, expected, false);
730 }
731
732 #[test]
733 fn regression_test_55() {
734 let original = r##"> [foo bar]: /url
735 >
736 > [foo
737 > bar]
738 "##;
739 let expected = r##"<blockquote>
740 <p><a href="/url">foo
741 bar</a></p>
742 </blockquote>
743 "##;
744
745 test_markdown_html(original, expected, false);
746 }
747
748 #[test]
749 fn regression_test_56() {
750 let original = r##"> - [a
751 > b c]: /foo
752
753 [a b c]
754 "##;
755 let expected = r##"<blockquote>
756 <ul>
757 <li></li>
758 </ul>
759 </blockquote>
760 <p><a href="/foo">a b c</a></p>
761 "##;
762
763 test_markdown_html(original, expected, false);
764 }
765
766 #[test]
767 fn regression_test_57() {
768 let original = r##"[a
769 > b]: /foo
770
771 [a b] [a > b]
772 "##;
773 let expected = r##"<p>[a</p>
774 <blockquote>
775 <p>b]: /foo</p>
776 </blockquote>
777 <p>[a b] [a > b]</p>
778 "##;
779
780 test_markdown_html(original, expected, false);
781 }
782
783 #[test]
784 fn regression_test_58() {
785 let original = r##"[`cargo
786 package`]
787
788 [`cargo package`]: https://example.com
789 "##;
790 let expected = r##"<p><a href="https://example.com"><code>cargo package</code></a></p>
791 "##;
792
793 test_markdown_html(original, expected, false);
794 }
795
796 #[test]
797 fn regression_test_59() {
798 let original = r##"> [`cargo
799 > package`]
800
801 [`cargo package`]: https://example.com
802 "##;
803 let expected = r##"<blockquote>
804 <p><a href="https://example.com"><code>cargo package</code></a></p>
805 </blockquote>
806 "##;
807
808 test_markdown_html(original, expected, false);
809 }
810
811 #[test]
812 fn regression_test_60() {
813 let original = r##"> `cargo
814 > package`
815 "##;
816 let expected = r##"<blockquote>
817 <p><code>cargo package</code></p>
818 "##;
819
820 test_markdown_html(original, expected, false);
821 }
822
823 #[test]
824 fn regression_test_61() {
825 let original = r##"> Note: Though you should not rely on this, all pointers to <abbr
826 > title="Dynamically Sized Types">DSTs</abbr> are currently twice the size of
827 > the size of `usize` and have the same alignment.
828 "##;
829 let expected = r##"<blockquote>
830 <p>Note: Though you should not rely on this, all pointers to
831 <abbr title="Dynamically Sized Types">DSTs</abbr> are currently twice the size of
832 the size of <code>usize</code> and have the same alignment.</p>
833 </blockquote>
834 "##;
835
836 test_markdown_html(original, expected, false);
837 }
838
839 #[test]
840 fn regression_test_62() {
841 let original = r##"Lorem ipsum.[^a]
842
843 An unordered list before the footnotes:
844 * Ipsum
845 * Lorem
846
847 [^a]: Cool.
848 "##;
849 let expected = r##"<p>Lorem ipsum.<sup class="footnote-reference"><a href="#a">1</a></sup></p>
850 <p>An unordered list before the footnotes:</p>
851 <ul>
852 <li>Ipsum</li>
853 <li>Lorem</li>
854 </ul>
855 <div class="footnote-definition" id="a"><sup class="footnote-definition-label">1</sup>
856 <p>Cool.</p>
857 </div>
858 "##;
859
860 test_markdown_html(original, expected, false);
861 }
862
863 #[test]
864 fn regression_test_63() {
865 let original = r##"[][a]
866
867 [a]: b
868
869 # assimp-rs [![][crates-badge]][crates]
870
871 [crates]: https://crates.io/crates/assimp
872 [crates-badge]: http://meritbadge.herokuapp.com/assimp
873 "##;
874 let expected = r##"<p><a href="b"></a></p>
875
876 <h1>assimp-rs <a href="https://crates.io/crates/assimp"><img alt="" src="http://meritbadge.herokuapp.com/assimp"></a></h1>
877 "##;
878
879 test_markdown_html(original, expected, false);
880 }
881
882 #[test]
883 fn regression_test_64() {
884 let original = r##"* A list.
885
886 * A sublist.
887
888 * Another sublist.
889
890
891 * A list.
892
893 * A sublist.
894
895 * Another sublist.
896
897 "##;
898 let expected = r##"<ul>
899 <li>
900 <p>A list.</p>
901 <ul>
902 <li>
903 <p>A sublist.</p>
904 </li>
905 <li>
906 <p>Another sublist.</p>
907 </li>
908 </ul>
909 </li>
910 <li>
911 <p>A list.</p>
912 <ul>
913 <li>
914 <p>A sublist.</p>
915 </li>
916 <li>
917 <p>Another sublist.</p>
918 </li>
919 </ul>
920 </li>
921 </ul>
922 "##;
923
924 test_markdown_html(original, expected, false);
925 }
926
927 #[test]
928 fn regression_test_65() {
929 let original = r##"<foo
930 "##;
931 let expected = r##"<p>&lt;foo</p>
932 "##;
933
934 test_markdown_html(original, expected, false);
935 }
936
937 #[test]
938 fn regression_test_66() {
939 let original = r##"> > a <a href
940 > > ="yo
941 > > lo">
942 "##;
943 let expected = r##"<blockquote>
944 <blockquote>
945 <p>a <a href
946 ="yo
947 lo"></p>
948 </blockquote>
949 </blockquote>
950 "##;
951
952 test_markdown_html(original, expected, false);
953 }