diff options
| author | binarycat <binarycat@envs.net> | 2025-08-17 12:35:54 -0500 |
|---|---|---|
| committer | binarycat <binarycat@envs.net> | 2025-08-21 15:00:00 -0500 |
| commit | e50fed79a857ccf3ea516fb4d7fdab665b7a573c (patch) | |
| tree | d6336e6401dddacece1a7f145fe0021d4f1b5557 /tests/rustdoc-ui | |
| parent | 6ba0ce40941eee1ca02e9ba49c791ada5158747a (diff) | |
| download | rust-e50fed79a857ccf3ea516fb4d7fdab665b7a573c.tar.gz rust-e50fed79a857ccf3ea516fb4d7fdab665b7a573c.zip | |
add regression test for #145529
Diffstat (limited to 'tests/rustdoc-ui')
| -rw-r--r-- | tests/rustdoc-ui/lints/invalid-html-tags.rs | 31 | ||||
| -rw-r--r-- | tests/rustdoc-ui/lints/invalid-html-tags.stderr | 14 |
2 files changed, 44 insertions, 1 deletions
diff --git a/tests/rustdoc-ui/lints/invalid-html-tags.rs b/tests/rustdoc-ui/lints/invalid-html-tags.rs index 317f1fd1d46..b2f516725fa 100644 --- a/tests/rustdoc-ui/lints/invalid-html-tags.rs +++ b/tests/rustdoc-ui/lints/invalid-html-tags.rs @@ -121,3 +121,34 @@ pub fn no_error_1() {} /// backslashed \<<a href=""> //~^ ERROR unclosed HTML tag `a` pub fn p() {} + +/// <svg width="512" height="512" viewBox="0 0 512" fill="none" xmlns="http://www.w3.org/2000/svg"> +/// <rect +/// width="256" +/// height="256" +/// fill="#5064C8" +/// stroke="black" +/// /> +/// </svg> +pub fn no_error_2() {} + +/// <div> +/// <img +/// src="https://example.com/ferris.png" +/// width="512" +/// height="512" +/// /> +/// </div> +pub fn no_error_3() {} + +/// unfinished ALLOWED_UNCLOSED +/// +/// <br> +/// <img +//~^ ERROR unclosed HTML tag `img` +pub fn q() {} + +/// nested unfinished ALLOWED_UNCLOSED +/// <p><img</p> +//~^ ERROR unclosed HTML tag `img` +pub fn r() {} diff --git a/tests/rustdoc-ui/lints/invalid-html-tags.stderr b/tests/rustdoc-ui/lints/invalid-html-tags.stderr index 9c2bfcf2c3d..fc9849ff23c 100644 --- a/tests/rustdoc-ui/lints/invalid-html-tags.stderr +++ b/tests/rustdoc-ui/lints/invalid-html-tags.stderr @@ -100,5 +100,17 @@ error: unclosed HTML tag `a` LL | /// backslashed \<<a href=""> | ^^ -error: aborting due to 16 previous errors +error: unclosed HTML tag `img` + --> $DIR/invalid-html-tags.rs:147:5 + | +LL | /// <img + | ^^^ + +error: unclosed HTML tag `img` + --> $DIR/invalid-html-tags.rs:152:8 + | +LL | /// <p><img</p> + | ^^^^ + +error: aborting due to 18 previous errors |
