From 695846331b1f0f39ce2fc6dff90edce03c958d12 Mon Sep 17 00:00:00 2001 From: Seo Sanghyeon Date: Fri, 27 Feb 2015 00:28:57 +0900 Subject: [PATCH] Add a rustdoc test for default methods in external crates --- .../rustdoc-extern-default-method/Makefile | 6 ++++++ .../rustdoc-extern-default-method/ext.rs | 21 +++++++++++++++++++ .../rustdoc-extern-default-method/lib.rs | 14 +++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 src/test/run-make/rustdoc-extern-default-method/Makefile create mode 100644 src/test/run-make/rustdoc-extern-default-method/ext.rs create mode 100644 src/test/run-make/rustdoc-extern-default-method/lib.rs diff --git a/src/test/run-make/rustdoc-extern-default-method/Makefile b/src/test/run-make/rustdoc-extern-default-method/Makefile new file mode 100644 index 000000000000..ffc4a08f8018 --- /dev/null +++ b/src/test/run-make/rustdoc-extern-default-method/Makefile @@ -0,0 +1,6 @@ +-include ../tools.mk + +all: lib.rs ext.rs + $(HOST_RPATH_ENV) $(RUSTC) ext.rs + $(HOST_RPATH_ENV) $(RUSTDOC) -L $(TMPDIR) -w html -o $(TMPDIR)/doc lib.rs + $(HTMLDOCCK) $(TMPDIR)/doc lib.rs diff --git a/src/test/run-make/rustdoc-extern-default-method/ext.rs b/src/test/run-make/rustdoc-extern-default-method/ext.rs new file mode 100644 index 000000000000..861562753f99 --- /dev/null +++ b/src/test/run-make/rustdoc-extern-default-method/ext.rs @@ -0,0 +1,21 @@ +// Copyright 2015 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![crate_type="lib"] + +pub trait Trait { + fn provided(&self) {} +} + +pub struct Struct; + +impl Trait for Struct { + fn provided(&self) {} +} diff --git a/src/test/run-make/rustdoc-extern-default-method/lib.rs b/src/test/run-make/rustdoc-extern-default-method/lib.rs new file mode 100644 index 000000000000..df92764dc9ae --- /dev/null +++ b/src/test/run-make/rustdoc-extern-default-method/lib.rs @@ -0,0 +1,14 @@ +// Copyright 2015 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +extern crate ext; + +// @count lib/struct.Struct.html '//*[@id="method.provided"]' 1 +pub use ext::Struct;