]> git.proxmox.com Git - rustc.git/blob - vendor/pulldown-cmark/tests/suite/regression.rs
New upstream version 1.44.1+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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
460 }
461
462 #[test]
463 fn regression_test_34() {
464 let original = r##"> foo | bar
465 > --- | ---
466 yolo | swag
467 "##;
468 let expected = r##"<blockquote>
469 <table><thead><tr><th>foo</th><th>bar</th></tr></thead></table>
470 </blockquote>
471 <p>yolo | swag</p>
472 "##;
473
474 test_markdown_html(original, expected);
475 }
476
477 #[test]
478 fn regression_test_35() {
479 let original = r##"<foo bar>
480 "##;
481 let expected = r##"<foo bar>
482 "##;
483
484 test_markdown_html(original, expected);
485 }
486
487 #[test]
488 fn regression_test_36() {
489 let original = r##"<foo bar =
490 "hi">
491 "##;
492 let expected = r##"<p><foo bar =
493 "hi"> </p>
494 "##;
495
496 test_markdown_html(original, expected);
497 }
498
499 #[test]
500 fn regression_test_37() {
501 let original = r##"~~*_**__
502
503 __a__
504 "##;
505 let expected = r##"<p>~~*_**__</p>
506 <p><strong>a</strong></p>
507 "##;
508
509 test_markdown_html(original, expected);
510 }
511
512 #[test]
513 fn regression_test_38() {
514 let original = r##"> `
515 > `
516 "##;
517 let expected = r##"<blockquote>
518 <p><code></code></p>
519 </blockquote>
520 "##;
521
522 test_markdown_html(original, expected);
523 }
524
525 #[test]
526 fn regression_test_39() {
527 let original = r##"`\|`
528 "##;
529 let expected = r##"<p><code>\|</code></p>
530 "##;
531
532 test_markdown_html(original, expected);
533 }
534
535 #[test]
536 fn regression_test_40() {
537 let original = r##"Paragraph 1
538
539 Paragraph 2
540 "##;
541 let expected = r##"<p>Paragraph 1</p>
542 <p>Paragraph 2</p>
543 "##;
544
545 test_markdown_html(original, expected);
546 }
547
548 #[test]
549 fn regression_test_41() {
550 let original = r##"\[[link text](https://www.google.com/)\]
551 "##;
552 let expected = r##"<p>[<a href="https://www.google.com/">link text</a>]</p>
553 "##;
554
555 test_markdown_html(original, expected);
556 }
557
558 #[test]
559 fn regression_test_42() {
560 let original = r##"foo | bar
561 --- | ---
562 [a](< | url>)
563 "##;
564 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>
565 "##;
566
567 test_markdown_html(original, expected);
568 }
569
570 #[test]
571 fn regression_test_43() {
572 let original = r##"[a](url "
573 - - -
574 ")
575 "##;
576 let expected = r##"<p>[a](url "</p>
577 <hr>
578 <p>")</p>
579 "##;
580
581 test_markdown_html(original, expected);
582 }
583
584 #[test]
585 fn regression_test_44() {
586 let original = r##"[a](url
587
588 )
589 "##;
590 let expected = r##"<p>[a](url</p>
591 <p>)</p>
592 "##;
593
594 test_markdown_html(original, expected);
595 }
596
597 #[test]
598 fn regression_test_45() {
599 let original = r##"[a](b "
600
601 ")
602 "##;
603 let expected = r##"<p>[a](b &quot;</p>
604 <p>&quot;)</p>
605 "##;
606
607 test_markdown_html(original, expected);
608 }
609
610 #[test]
611 fn regression_test_46() {
612 let original = r##"<http:// >
613 "##;
614 let expected = r##"<p>&lt;http:// &gt;</p>
615 "##;
616
617 test_markdown_html(original, expected);
618 }
619
620 #[test]
621 fn regression_test_47() {
622 let original = r##"<http://\a>
623 "##;
624 let expected = r##"<p>&lt;http://\a&gt;</p>
625 "##;
626
627 test_markdown_html(original, expected);
628 }
629
630 #[test]
631 fn regression_test_48() {
632 let original = r##"foo | bar
633 --- | ---
634 <http://| baz
635 "##;
636 let expected = r##"<table>
637 <thead>
638 <tr><th>foo</th><th>bar</th></tr>
639 </thead>
640 <tbody>
641 <tr><td>&lt;http://</td><td>baz</td></tr>
642 </tbody>
643 </table>
644 "##;
645
646 test_markdown_html(original, expected);
647 }
648
649 #[test]
650 fn regression_test_49() {
651 let original = r##"foo | bar
652 --- | ---
653 <http://|>
654 "##;
655 let expected = r##"<table>
656 <thead>
657 <tr><th>foo</th><th>bar</th></tr>
658 </thead>
659 <tbody>
660 <tr><td>&lt;http://</td><td>&gt;</td></tr>
661 </tbody>
662 </table>
663 "##;
664
665 test_markdown_html(original, expected);
666 }
667
668 #[test]
669 fn regression_test_50() {
670 let original = r##"<sup>\*hi</sup>\_
671 "##;
672 let expected = r##"<p><sup>*hi</sup>_</p>
673 "##;
674
675 test_markdown_html(original, expected);
676 }
677
678 #[test]
679 fn regression_test_51() {
680 let original = r##"email: <john@example.com>\_
681 "##;
682 let expected = r##"<p>email: <a href="mailto:john@example.com">john@example.com</a>_</p>
683 "##;
684
685 test_markdown_html(original, expected);
686 }
687
688 #[test]
689 fn regression_test_52() {
690 let original = r##"> [link](/url 'foo
691 > bar')
692 "##;
693 let expected = r##"<blockquote>
694 <p><a href="/url" title="foo
695 bar">link</a></p>
696 </blockquote>
697 "##;
698
699 test_markdown_html(original, expected);
700 }
701
702 #[test]
703 fn regression_test_53() {
704 let original = r##"> [foo
705 > bar]: /url
706 >
707 > [foo bar]
708 "##;
709 let expected = r##"<blockquote>
710 <p><a href="/url">foo bar</a></p>
711 </blockquote>
712 "##;
713
714 test_markdown_html(original, expected);
715 }
716
717 #[test]
718 fn regression_test_54() {
719 let original = r##"> [foo bar]: /url
720 >
721 > [foo
722 > bar]
723 "##;
724 let expected = r##"<blockquote>
725 <p><a href="/url">foo
726 bar</a></p>
727 </blockquote>
728 "##;
729
730 test_markdown_html(original, expected);
731 }
732
733 #[test]
734 fn regression_test_55() {
735 let original = r##"> - [a
736 > b c]: /foo
737
738 [a b c]
739 "##;
740 let expected = r##"<blockquote>
741 <ul>
742 <li></li>
743 </ul>
744 </blockquote>
745 <p><a href="/foo">a b c</a></p>
746 "##;
747
748 test_markdown_html(original, expected);
749 }
750
751 #[test]
752 fn regression_test_56() {
753 let original = r##"[a
754 > b]: /foo
755
756 [a b] [a > b]
757 "##;
758 let expected = r##"<p>[a</p>
759 <blockquote>
760 <p>b]: /foo</p>
761 </blockquote>
762 <p>[a b] [a > b]</p>
763 "##;
764
765 test_markdown_html(original, expected);
766 }
767
768 #[test]
769 fn regression_test_57() {
770 let original = r##"[`cargo
771 package`]
772
773 [`cargo package`]: https://example.com
774 "##;
775 let expected = r##"<p><a href="https://example.com"><code>cargo package</code></a></p>
776 "##;
777
778 test_markdown_html(original, expected);
779 }
780
781 #[test]
782 fn regression_test_58() {
783 let original = r##"> [`cargo
784 > package`]
785
786 [`cargo package`]: https://example.com
787 "##;
788 let expected = r##"<blockquote>
789 <p><a href="https://example.com"><code>cargo package</code></a></p>
790 </blockquote>
791 "##;
792
793 test_markdown_html(original, expected);
794 }
795
796 #[test]
797 fn regression_test_59() {
798 let original = r##"> `cargo
799 > package`
800 "##;
801 let expected = r##"<blockquote>
802 <p><code>cargo package</code></p>
803 "##;
804
805 test_markdown_html(original, expected);
806 }
807
808 #[test]
809 fn regression_test_60() {
810 let original = r##"Lorem ipsum.[^a]
811
812 An unordered list before the footnotes:
813 * Ipsum
814 * Lorem
815
816 [^a]: Cool.
817 "##;
818 let expected = r##"<p>Lorem ipsum.<sup class="footnote-reference"><a href="#a">1</a></sup></p>
819 <p>An unordered list before the footnotes:</p>
820 <ul>
821 <li>Ipsum</li>
822 <li>Lorem</li>
823 </ul>
824 <div class="footnote-definition" id="a"><sup class="footnote-definition-label">1</sup>
825 <p>Cool.</p>
826 </div>
827 "##;
828
829 test_markdown_html(original, expected);
830 }
831
832 #[test]
833 fn regression_test_61() {
834 let original = r##"[][a]
835
836 [a]: b
837
838 # assimp-rs [![][crates-badge]][crates]
839
840 [crates]: https://crates.io/crates/assimp
841 [crates-badge]: http://meritbadge.herokuapp.com/assimp
842 "##;
843 let expected = r##"<p><a href="b"></a></p>
844
845 <h1>assimp-rs <a href="https://crates.io/crates/assimp"><img alt="" src="http://meritbadge.herokuapp.com/assimp"></a></h1>
846 "##;
847
848 test_markdown_html(original, expected);
849 }
850
851 #[test]
852 fn regression_test_62() {
853 let original = "<foo";
854 let expected = r##"<p>&lt;foo</p>
855 "##;
856
857 test_markdown_html(original, expected);
858 }