Skip to content

Commit 56a1ee8

Browse files
committed
librustdoc: Remove old-style extern mods from rustdoc tests.
1 parent 58a37a1 commit 56a1ee8

File tree

4 files changed

+5
-29
lines changed

4 files changed

+5
-29
lines changed

src/librustdoc/markdown_index_pass.rs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -252,20 +252,6 @@ mod test {
252252
});
253253
}
254254
255-
#[test]
256-
fn should_index_foreign_mod_pages() {
257-
let doc = mk_doc(
258-
config::DocPerMod,
259-
~"extern mod a { }"
260-
);
261-
assert!((&doc.cratemod().index).get().entries[0] == doc::IndexEntry {
262-
kind: ~"Foreign module",
263-
name: ~"a",
264-
brief: None,
265-
link: ~"a.html"
266-
});
267-
}
268-
269255
#[test]
270256
fn should_add_brief_desc_to_index() {
271257
let doc = mk_doc(
@@ -280,7 +266,7 @@ mod test {
280266
fn should_index_foreign_mod_contents() {
281267
let doc = mk_doc(
282268
config::DocPerCrate,
283-
~"extern mod a { fn b(); }"
269+
~"extern { fn b(); }"
284270
);
285271
assert!((&doc.cratemod().nmods()[0].index).get().entries[0]
286272
== doc::IndexEntry {

src/librustdoc/markdown_pass.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -702,31 +702,24 @@ mod test {
702702

703703
#[test]
704704
fn should_write_index_for_foreign_mods() {
705-
let markdown = render(~"extern mod a { fn a(); }");
705+
let markdown = render(~"extern { fn a(); }");
706706
assert!(str::contains(
707707
markdown,
708708
~"\n\n* [Function `a`](#function-a)\n\n"
709709
));
710710
}
711711

712-
#[test]
713-
fn should_write_foreign_mods() {
714-
let markdown = render(~"#[doc = \"test\"] extern mod a { }");
715-
assert!(str::contains(markdown, ~"Foreign module `a`"));
716-
assert!(str::contains(markdown, ~"test"));
717-
}
718-
719712
#[test]
720713
fn should_write_foreign_fns() {
721714
let markdown = render(
722-
~"extern mod a { #[doc = \"test\"] fn a(); }");
715+
~"extern { #[doc = \"test\"] fn a(); }");
723716
assert!(str::contains(markdown, ~"test"));
724717
}
725718
726719
#[test]
727720
fn should_write_foreign_fn_headers() {
728721
let markdown = render(
729-
~"extern mod a { #[doc = \"test\"] fn a(); }");
722+
~"extern { #[doc = \"test\"] fn a(); }");
730723
assert!(str::contains(markdown, ~"## Function `a`"));
731724
}
732725

src/librustdoc/sort_item_type_pass.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ fn test() {
4343

4444
let source =
4545
~"mod imod { } \
46-
extern mod inmod {
47-
} \
4846
static iconst: int = 0; \
4947
fn ifn() { } \
5048
enum ienum { ivar } \
@@ -63,6 +61,5 @@ fn test() {
6361
assert!(doc.cratemod().items[5].name() == ~"__extensions__");
6462
assert!(doc.cratemod().items[6].name() == ~"ifn");
6563
assert!(doc.cratemod().items[7].name() == ~"imod");
66-
assert!(doc.cratemod().items[8].name() == ~"inmod");
6764
}
6865
}

src/librustdoc/tystr_pass.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ mod test {
365365
366366
#[test]
367367
fn should_add_foreign_fn_sig() {
368-
let doc = mk_doc(~"extern mod a { fn a<T>() -> int; }");
368+
let doc = mk_doc(~"extern { fn a<T>() -> int; }");
369369
assert!(doc.cratemod().nmods()[0].fns[0].sig ==
370370
Some(~"fn a<T>() -> int"));
371371
}

0 commit comments

Comments
 (0)