auto merge of #11185 : huonw/rust/doc-ignore, r=cmr
Currently any line starting with `#` is filtered from the output, including line like `#[deriving]`; this patch makes it so lines are only filtered when followed by a space similar to the current behaviour of the tutorial/manual tester.
This commit is contained in:
commit
a4f30bf0c0
6 changed files with 57 additions and 7 deletions
7
src/test/run-make/rustdoc-hidden-line/Makefile
Normal file
7
src/test/run-make/rustdoc-hidden-line/Makefile
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
-include ../tools.mk
|
||||
|
||||
all:
|
||||
$(RUSTDOC) --test foo.rs
|
||||
$(RUSTDOC) -w html -o $(TMPDIR)/doc foo.rs
|
||||
cp verify.sh $(TMPDIR)
|
||||
$(call RUN,verify.sh) $(TMPDIR)
|
||||
22
src/test/run-make/rustdoc-hidden-line/foo.rs
Normal file
22
src/test/run-make/rustdoc-hidden-line/foo.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#[crate_id="foo#0.1"];
|
||||
|
||||
/// The '# ' lines should be removed from the output, but the #[deriving] should be
|
||||
/// retained.
|
||||
///
|
||||
/// ```rust
|
||||
/// mod to_make_deriving_work { // FIXME #4913
|
||||
///
|
||||
/// # #[deriving(Eq)] // invisible
|
||||
/// # struct Foo; // invisible
|
||||
///
|
||||
/// #[deriving(Eq)] // Bar
|
||||
/// struct Bar(Foo);
|
||||
///
|
||||
/// fn test() {
|
||||
/// let x = Bar(Foo);
|
||||
/// assert!(x == x); // check that the derivings worked
|
||||
/// }
|
||||
///
|
||||
/// }
|
||||
/// ```
|
||||
pub fn foo() {}
|
||||
8
src/test/run-make/rustdoc-hidden-line/verify.sh
Executable file
8
src/test/run-make/rustdoc-hidden-line/verify.sh
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
file="$1/doc/foo/fn.foo.html"
|
||||
|
||||
grep -v 'invisible' $file &&
|
||||
grep '#\[deriving(Eq)\] // Bar' $file
|
||||
|
||||
exit $?
|
||||
Loading…
Add table
Add a link
Reference in a new issue