about summary refs log tree commit diff
path: root/src/test/rustdoc
diff options
context:
space:
mode:
authorQuietMisdreavus <grey@quietmisdreavus.net>2017-12-28 16:48:30 -0600
committerManish Goregaokar <manishsmail@gmail.com>2018-01-22 15:24:28 +0530
commit30fca0919c8bcb7995982d4141b3a6f2e651c5a6 (patch)
tree29f236d4e37a75415ab97aaf13490424ac14cf95 /src/test/rustdoc
parentc4a4d3a031301248f8769960bc1c0eb43cb779ec (diff)
downloadrust-30fca0919c8bcb7995982d4141b3a6f2e651c5a6.tar.gz
rust-30fca0919c8bcb7995982d4141b3a6f2e651c5a6.zip
add basic test for rustdoc intra links
Diffstat (limited to 'src/test/rustdoc')
-rw-r--r--src/test/rustdoc/intra-links.rs39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/test/rustdoc/intra-links.rs b/src/test/rustdoc/intra-links.rs
new file mode 100644
index 00000000000..f1165c9a6e4
--- /dev/null
+++ b/src/test/rustdoc/intra-links.rs
@@ -0,0 +1,39 @@
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// @has intra_links/index.html
+// @has - '//a/@href' '../intra_links/struct.ThisType.html'
+// @has - '//a/@href' '../intra_links/enum.ThisEnum.html'
+// @has - '//a/@href' '../intra_links/trait.ThisTrait.html'
+// @has - '//a/@href' '../intra_links/type.ThisAlias.html'
+// @has - '//a/@href' '../intra_links/union.ThisUnion.html'
+// @has - '//a/@href' '../intra_links/fn.this_function.html'
+// @has - '//a/@href' '../intra_links/constant.THIS_CONST.html'
+// @has - '//a/@href' '../intra_links/static.THIS_STATIC.html'
+//! In this crate we would like to link to:
+//!
+//! * [`ThisType`](struct ::ThisType)
+//! * [`ThisEnum`](enum ::ThisEnum)
+//! * [`ThisTrait`](trait ::ThisTrait)
+//! * [`ThisAlias`](type ::ThisAlias)
+//! * [`ThisUnion`](union ::ThisUnion)
+//! * [`this_function`](::this_function())
+//! * [`THIS_CONST`](const ::THIS_CONST)
+//! * [`THIS_STATIC`](static ::THIS_STATIC)
+
+pub struct ThisType;
+pub enum ThisEnum { ThisVariant, }
+pub trait ThisTrait {}
+pub type ThisAlias = Result<(), ()>;
+pub union ThisUnion { this_field: usize, }
+
+pub fn this_function() {}
+pub const THIS_CONST: usize = 5usize;
+pub static THIS_STATIC: usize = 5usize;