about summary refs log tree commit diff
path: root/tests/rustdoc/attributes.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rustdoc/attributes.rs')
-rw-r--r--tests/rustdoc/attributes.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/rustdoc/attributes.rs b/tests/rustdoc/attributes.rs
index 33e4e31bec6..429a42a7252 100644
--- a/tests/rustdoc/attributes.rs
+++ b/tests/rustdoc/attributes.rs
@@ -9,6 +9,18 @@ pub extern "C" fn f() {}
 #[unsafe(export_name = "bar")]
 pub extern "C" fn g() {}
 
+//@ has foo/fn.escape_special.html '//*[@class="code-attribute"]' \
+//                                 '#[unsafe(export_name = "\n\"\n")]'
+#[unsafe(export_name = "\n\"
+")]
+pub extern "C" fn escape_special() {}
+
+// issue: <https://github.com/rust-lang/rust/issues/142835>
+//@ has foo/fn.escape_html.html '//*[@class="code-attribute"]' \
+//                              '#[unsafe(export_name = "<script>alert()</script>")]'
+#[unsafe(export_name = "<script>alert()</script>")]
+pub extern "C" fn escape_html() {}
+
 //@ has foo/fn.example.html '//*[@class="code-attribute"]' '#[unsafe(link_section = ".text")]'
 #[unsafe(link_section = ".text")]
 pub extern "C" fn example() {}