Change remaining "iface" occurrences to "trait"; deprecate "iface"

This commit is contained in:
Lindsey Kuper
2012-07-31 10:27:51 -07:00
parent c2f49c46ae
commit 439afaa329
111 changed files with 194 additions and 188 deletions
+2 -2
View File
@@ -242,14 +242,14 @@ fn merge_method_attrs(
#[test]
fn should_extract_trait_docs() {
let doc = test::mk_doc(~"#[doc = \"whatever\"] iface i { fn a(); }");
let doc = test::mk_doc(~"#[doc = \"whatever\"] trait i { fn a(); }");
assert doc.cratemod().traits()[0].desc() == some(~"whatever");
}
#[test]
fn should_extract_trait_method_docs() {
let doc = test::mk_doc(
~"iface i {\
~"trait i {\
#[doc = \"desc\"]\
fn f(a: bool) -> bool;\
}");
+1 -1
View File
@@ -133,7 +133,7 @@ mod blade_runner {
* neighboring hillside churchyard of St. John's, whose hidden expanse of
* Eighteenth Century gravestones had for him a peculiar fascination.
*/
iface the_shunned_house {
trait the_shunned_house {
/**
* Now the irony is this. In this walk, so many times repeated, the
* world's greatest master of the terrible and the bizarre was
+1 -1
View File
@@ -70,7 +70,7 @@ fn should_promote_desc() {
#[test]
fn should_promote_trait_method_desc() {
let doc = test::mk_doc(~"iface i { #[doc = \"desc\"] fn a(); }");
let doc = test::mk_doc(~"trait i { #[doc = \"desc\"] fn a(); }");
assert doc.cratemod().traits()[0].methods[0].brief == some(~"desc");
}
+1 -1
View File
@@ -315,7 +315,7 @@ fn types() -> ~[tydoc] {
}
}
iface item {
trait item {
fn item() -> itemdoc;
}
+4 -4
View File
@@ -666,28 +666,28 @@ fn write_method(ctxt: ctxt, doc: doc::methoddoc) {
#[test]
fn should_write_trait_header() {
let markdown = test::render(~"iface i { fn a(); }");
let markdown = test::render(~"trait i { fn a(); }");
assert str::contains(markdown, ~"## Interface `i`");
}
#[test]
fn should_write_trait_desc() {
let markdown = test::render(
~"#[doc = \"desc\"] iface i { fn a(); }");
~"#[doc = \"desc\"] trait i { fn a(); }");
assert str::contains(markdown, ~"desc");
}
#[test]
fn should_write_trait_method_header() {
let markdown = test::render(
~"iface i { fn a(); }");
~"trait i { fn a(); }");
assert str::contains(markdown, ~"### Method `a`");
}
#[test]
fn should_write_trait_method_signature() {
let markdown = test::render(
~"iface i { fn a(); }");
~"trait i { fn a(); }");
assert str::contains(markdown, ~"\n fn a()");
}
+1 -1
View File
@@ -206,7 +206,7 @@ fn should_eliminate_desc_if_it_is_just_whitespace() {
#[test]
fn should_sectionalize_trait_methods() {
let doc = test::mk_doc(
~"iface i {
~"trait i {
#[doc = \"\
# Header\n\
Body\"]\
+2 -2
View File
@@ -31,7 +31,7 @@ fn test() {
const iconst: int = 0; \
fn ifn() { } \
enum ienum { ivar } \
iface iiface { fn a(); } \
trait itrait { fn a(); } \
impl iimpl for int { fn a() { } } \
type itype = int;";
do astsrv::from_str(source) |srv| {
@@ -40,7 +40,7 @@ impl iimpl for int { fn a() { } } \
assert doc.cratemod().items[0].name() == ~"iconst";
assert doc.cratemod().items[1].name() == ~"itype";
assert doc.cratemod().items[2].name() == ~"ienum";
assert doc.cratemod().items[3].name() == ~"iiface";
assert doc.cratemod().items[3].name() == ~"itrait";
assert doc.cratemod().items[4].name() == ~"iimpl";
assert doc.cratemod().items[5].name() == ~"ifn";
assert doc.cratemod().items[6].name() == ~"imod";
+6 -6
View File
@@ -117,28 +117,28 @@ fn should_execute_op_on_variant_desc() {
#[test]
fn should_execute_op_on_trait_brief() {
let doc = test::mk_doc(
~"#[doc = \" a \"] iface i { fn a(); }");
~"#[doc = \" a \"] trait i { fn a(); }");
assert doc.cratemod().traits()[0].brief() == some(~"a");
}
#[test]
fn should_execute_op_on_trait_desc() {
let doc = test::mk_doc(
~"#[doc = \" a \"] iface i { fn a(); }");
~"#[doc = \" a \"] trait i { fn a(); }");
assert doc.cratemod().traits()[0].desc() == some(~"a");
}
#[test]
fn should_execute_op_on_trait_method_brief() {
let doc = test::mk_doc(
~"iface i { #[doc = \" a \"] fn a(); }");
~"trait i { #[doc = \" a \"] fn a(); }");
assert doc.cratemod().traits()[0].methods[0].brief == some(~"a");
}
#[test]
fn should_execute_op_on_trait_method_desc() {
let doc = test::mk_doc(
~"iface i { #[doc = \" a \"] fn a(); }");
~"trait i { #[doc = \" a \"] fn a(); }");
assert doc.cratemod().traits()[0].methods[0].desc == some(~"a");
}
@@ -207,7 +207,7 @@ fn should_execute_on_item_section_bodies() {
#[test]
fn should_execute_on_trait_method_section_headers() {
let doc = test::mk_doc(
~"iface i {
~"trait i {
#[doc = \"\
# Header \n\
Body\"]\
@@ -219,7 +219,7 @@ fn should_execute_on_trait_method_section_headers() {
#[test]
fn should_execute_on_trait_method_section_bodies() {
let doc = test::mk_doc(
~"iface i {
~"trait i {
#[doc = \"\
# Header\n\
Body \"]\
+1 -1
View File
@@ -218,7 +218,7 @@ fn get_method_sig(
#[test]
fn should_add_trait_method_sigs() {
let doc = test::mk_doc(~"iface i { fn a<T>() -> int; }");
let doc = test::mk_doc(~"trait i { fn a<T>() -> int; }");
assert doc.cratemod().traits()[0].methods[0].sig
== some(~"fn a<T>() -> int");
}