librustdoc: Remove old-style extern mods from rustdoc tests.
This commit is contained in:
parent
58a37a1f48
commit
56a1ee8f84
@ -252,20 +252,6 @@ mod test {
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn should_index_foreign_mod_pages() {
|
||||
let doc = mk_doc(
|
||||
config::DocPerMod,
|
||||
~"extern mod a { }"
|
||||
);
|
||||
assert!((&doc.cratemod().index).get().entries[0] == doc::IndexEntry {
|
||||
kind: ~"Foreign module",
|
||||
name: ~"a",
|
||||
brief: None,
|
||||
link: ~"a.html"
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn should_add_brief_desc_to_index() {
|
||||
let doc = mk_doc(
|
||||
@ -280,7 +266,7 @@ mod test {
|
||||
fn should_index_foreign_mod_contents() {
|
||||
let doc = mk_doc(
|
||||
config::DocPerCrate,
|
||||
~"extern mod a { fn b(); }"
|
||||
~"extern { fn b(); }"
|
||||
);
|
||||
assert!((&doc.cratemod().nmods()[0].index).get().entries[0]
|
||||
== doc::IndexEntry {
|
||||
|
@ -702,31 +702,24 @@ mod test {
|
||||
|
||||
#[test]
|
||||
fn should_write_index_for_foreign_mods() {
|
||||
let markdown = render(~"extern mod a { fn a(); }");
|
||||
let markdown = render(~"extern { fn a(); }");
|
||||
assert!(str::contains(
|
||||
markdown,
|
||||
~"\n\n* [Function `a`](#function-a)\n\n"
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn should_write_foreign_mods() {
|
||||
let markdown = render(~"#[doc = \"test\"] extern mod a { }");
|
||||
assert!(str::contains(markdown, ~"Foreign module `a`"));
|
||||
assert!(str::contains(markdown, ~"test"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn should_write_foreign_fns() {
|
||||
let markdown = render(
|
||||
~"extern mod a { #[doc = \"test\"] fn a(); }");
|
||||
~"extern { #[doc = \"test\"] fn a(); }");
|
||||
assert!(str::contains(markdown, ~"test"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn should_write_foreign_fn_headers() {
|
||||
let markdown = render(
|
||||
~"extern mod a { #[doc = \"test\"] fn a(); }");
|
||||
~"extern { #[doc = \"test\"] fn a(); }");
|
||||
assert!(str::contains(markdown, ~"## Function `a`"));
|
||||
}
|
||||
|
||||
|
@ -43,8 +43,6 @@ fn test() {
|
||||
|
||||
let source =
|
||||
~"mod imod { } \
|
||||
extern mod inmod {
|
||||
} \
|
||||
static iconst: int = 0; \
|
||||
fn ifn() { } \
|
||||
enum ienum { ivar } \
|
||||
@ -63,6 +61,5 @@ fn test() {
|
||||
assert!(doc.cratemod().items[5].name() == ~"__extensions__");
|
||||
assert!(doc.cratemod().items[6].name() == ~"ifn");
|
||||
assert!(doc.cratemod().items[7].name() == ~"imod");
|
||||
assert!(doc.cratemod().items[8].name() == ~"inmod");
|
||||
}
|
||||
}
|
||||
|
@ -365,7 +365,7 @@ mod test {
|
||||
|
||||
#[test]
|
||||
fn should_add_foreign_fn_sig() {
|
||||
let doc = mk_doc(~"extern mod a { fn a<T>() -> int; }");
|
||||
let doc = mk_doc(~"extern { fn a<T>() -> int; }");
|
||||
assert!(doc.cratemod().nmods()[0].fns[0].sig ==
|
||||
Some(~"fn a<T>() -> int"));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user