2012-04-10 12:52:06 -05:00
|
|
|
// aux-build:cci_class_6.rs
|
|
|
|
use cci_class_6;
|
|
|
|
import cci_class_6::kitties::*;
|
|
|
|
|
|
|
|
fn main() {
|
2012-06-29 18:26:56 -05:00
|
|
|
let nyan : cat<char> = cat::<char>(52u, 99, ~['p']);
|
|
|
|
let kitty = cat(1000u, 2, ~["tabby"]);
|
2012-04-10 12:52:06 -05:00
|
|
|
assert(nyan.how_hungry == 99);
|
|
|
|
assert(kitty.how_hungry == 2);
|
2012-06-29 18:26:56 -05:00
|
|
|
nyan.speak(~[1u,2u,3u]);
|
2012-04-10 12:52:06 -05:00
|
|
|
assert(nyan.meow_count() == 55u);
|
2012-06-29 18:26:56 -05:00
|
|
|
kitty.speak(~["meow", "mew", "purr", "chirp"]);
|
2012-04-10 12:52:06 -05:00
|
|
|
assert(kitty.meow_count() == 1004u);
|
|
|
|
}
|