librustdoc: Remove old-style extern mods from rustdoc tests.
This commit is contained in:
parent
58a37a1f48
commit
56a1ee8f84
4 changed files with 5 additions and 29 deletions
|
@ -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]
|
#[test]
|
||||||
fn should_add_brief_desc_to_index() {
|
fn should_add_brief_desc_to_index() {
|
||||||
let doc = mk_doc(
|
let doc = mk_doc(
|
||||||
|
@ -280,7 +266,7 @@ mod test {
|
||||||
fn should_index_foreign_mod_contents() {
|
fn should_index_foreign_mod_contents() {
|
||||||
let doc = mk_doc(
|
let doc = mk_doc(
|
||||||
config::DocPerCrate,
|
config::DocPerCrate,
|
||||||
~"extern mod a { fn b(); }"
|
~"extern { fn b(); }"
|
||||||
);
|
);
|
||||||
assert!((&doc.cratemod().nmods()[0].index).get().entries[0]
|
assert!((&doc.cratemod().nmods()[0].index).get().entries[0]
|
||||||
== doc::IndexEntry {
|
== doc::IndexEntry {
|
||||||
|
|
|
@ -702,31 +702,24 @@ mod test {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn should_write_index_for_foreign_mods() {
|
fn should_write_index_for_foreign_mods() {
|
||||||
let markdown = render(~"extern mod a { fn a(); }");
|
let markdown = render(~"extern { fn a(); }");
|
||||||
assert!(str::contains(
|
assert!(str::contains(
|
||||||
markdown,
|
markdown,
|
||||||
~"\n\n* [Function `a`](#function-a)\n\n"
|
~"\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]
|
#[test]
|
||||||
fn should_write_foreign_fns() {
|
fn should_write_foreign_fns() {
|
||||||
let markdown = render(
|
let markdown = render(
|
||||||
~"extern mod a { #[doc = \"test\"] fn a(); }");
|
~"extern { #[doc = \"test\"] fn a(); }");
|
||||||
assert!(str::contains(markdown, ~"test"));
|
assert!(str::contains(markdown, ~"test"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn should_write_foreign_fn_headers() {
|
fn should_write_foreign_fn_headers() {
|
||||||
let markdown = render(
|
let markdown = render(
|
||||||
~"extern mod a { #[doc = \"test\"] fn a(); }");
|
~"extern { #[doc = \"test\"] fn a(); }");
|
||||||
assert!(str::contains(markdown, ~"## Function `a`"));
|
assert!(str::contains(markdown, ~"## Function `a`"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,8 +43,6 @@ fn test() {
|
||||||
|
|
||||||
let source =
|
let source =
|
||||||
~"mod imod { } \
|
~"mod imod { } \
|
||||||
extern mod inmod {
|
|
||||||
} \
|
|
||||||
static iconst: int = 0; \
|
static iconst: int = 0; \
|
||||||
fn ifn() { } \
|
fn ifn() { } \
|
||||||
enum ienum { ivar } \
|
enum ienum { ivar } \
|
||||||
|
@ -63,6 +61,5 @@ fn test() {
|
||||||
assert!(doc.cratemod().items[5].name() == ~"__extensions__");
|
assert!(doc.cratemod().items[5].name() == ~"__extensions__");
|
||||||
assert!(doc.cratemod().items[6].name() == ~"ifn");
|
assert!(doc.cratemod().items[6].name() == ~"ifn");
|
||||||
assert!(doc.cratemod().items[7].name() == ~"imod");
|
assert!(doc.cratemod().items[7].name() == ~"imod");
|
||||||
assert!(doc.cratemod().items[8].name() == ~"inmod");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -365,7 +365,7 @@ mod test {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn should_add_foreign_fn_sig() {
|
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 ==
|
assert!(doc.cratemod().nmods()[0].fns[0].sig ==
|
||||||
Some(~"fn a<T>() -> int"));
|
Some(~"fn a<T>() -> int"));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue