e0da0dd446
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.
19 lines
358 B
Rust
19 lines
358 B
Rust
/* Test that exporting a class also exports its
|
|
public fields and methods */
|
|
|
|
import kitty::*;
|
|
|
|
mod kitty {
|
|
export cat;
|
|
class cat {
|
|
let meows: uint;
|
|
let name: str;
|
|
|
|
fn get_name() -> str { self.name }
|
|
new(in_name: str) { self.name = in_name; self.meows = 0u; }
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
assert(cat("Spreckles").get_name() == "Spreckles");
|
|
} |