Skip to content

Commit e0da0dd

Browse files
committed
Test for issue 2286
which is really kind of a non-issue because class methods aren't items that can be selectively imported/exported anyhow, unlike enum variants. But, might as well have a test.
1 parent 931514c commit e0da0dd

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/test/run-pass/class-exports.rs

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/* Test that exporting a class also exports its
2+
public fields and methods */
3+
4+
import kitty::*;
5+
6+
mod kitty {
7+
export cat;
8+
class cat {
9+
let meows: uint;
10+
let name: str;
11+
12+
fn get_name() -> str { self.name }
13+
new(in_name: str) { self.name = in_name; self.meows = 0u; }
14+
}
15+
}
16+
17+
fn main() {
18+
assert(cat("Spreckles").get_name() == "Spreckles");
19+
}

0 commit comments

Comments
 (0)