about summary refs log tree commit diff
path: root/tests/rustdoc/custom_code_classes.rs
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2023-04-25 15:04:46 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2023-09-15 21:32:28 +0200
commitf5561842e3dfc9adc8da4ba12b95514da4d99f00 (patch)
treec4fdfbd2d3ceeec51431bef931829c380c97946c /tests/rustdoc/custom_code_classes.rs
parent5515fc88dc45c274f0574d381a17d4f72dfd5047 (diff)
downloadrust-f5561842e3dfc9adc8da4ba12b95514da4d99f00.tar.gz
rust-f5561842e3dfc9adc8da4ba12b95514da4d99f00.zip
Add tests for `custom_code_classes_in_docs` feature
Diffstat (limited to 'tests/rustdoc/custom_code_classes.rs')
-rw-r--r--tests/rustdoc/custom_code_classes.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/rustdoc/custom_code_classes.rs b/tests/rustdoc/custom_code_classes.rs
new file mode 100644
index 00000000000..f110721c5a7
--- /dev/null
+++ b/tests/rustdoc/custom_code_classes.rs
@@ -0,0 +1,28 @@
+// Test for `custom_code_classes_in_docs` feature.
+
+#![feature(custom_code_classes_in_docs)]
+#![crate_name = "foo"]
+#![feature(no_core)]
+#![no_core]
+
+// @has 'foo/struct.Bar.html'
+// @has - '//*[@id="main-content"]//pre[@class="language-whatever hoho-c"]' 'main;'
+// @has - '//*[@id="main-content"]//pre[@class="language-whatever2 haha-c"]' 'main;'
+// @has - '//*[@id="main-content"]//pre[@class="language-whatever4 huhu-c"]' 'main;'
+
+/// ```{class=hoho-c},whatever
+/// main;
+/// ```
+///
+/// Testing multiple kinds of orders.
+///
+/// ```whatever2 {class=haha-c}
+/// main;
+/// ```
+///
+/// Testing with multiple "unknown". Only the first should be used.
+///
+/// ```whatever4{.huhu-c} whatever5
+/// main;
+/// ```
+pub struct Bar;