]> git.proxmox.com Git - rustc.git/blame - vendor/pulldown-cmark/tests/errors.rs
New upstream version 1.59.0+dfsg1
[rustc.git] / vendor / pulldown-cmark / tests / errors.rs
CommitLineData
a2a8927a
XL
1use pulldown_cmark::Parser;
2
3fn parse(md: &str) {
4 let parser = Parser::new(md);
5
6 for _ in parser {}
7}
8
9#[test]
10fn test_lists_inside_code_spans() {
11 parse(
12 r"- `
13x
14**
15 *
16 `",
17 );
18}
1b1a35ee
XL
19
20#[test]
21fn test_wrong_code_block() {
a2a8927a
XL
22 parse(
23 r##"```
1b1a35ee 24 * ```
a2a8927a
XL
25 "##,
26 );
1b1a35ee
XL
27}
28
29#[test]
30fn test_unterminated_link() {
a2a8927a 31 parse("[](\\");
1b1a35ee
XL
32}
33
34#[test]
35fn test_unterminated_autolink() {
a2a8927a 36 parse("<a");
1b1a35ee
XL
37}
38
39#[test]
40fn test_infinite_loop() {
a2a8927a 41 parse("[<!W\n\\\n");
1b1a35ee
XL
42}
43
44#[test]
45fn test_html_tag() {
a2a8927a
XL
46 parse("<script\u{feff}");
47}
1b1a35ee 48
a2a8927a
XL
49// all of test_bad_slice_* were found in https://github.com/raphlinus/pulldown-cmark/issues/521
50#[test]
51fn test_bad_slice_a() {
52 parse("><a\n");
53}
54
55#[test]
56fn test_bad_slice_b() {
57 parse("><a a\n");
58}
59
60#[test]
61fn test_bad_slice_unicode() {
62 parse("><a a=\n毿>")
1b1a35ee 63}