2012-12-10 19:32:48 -06:00
|
|
|
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2012-07-09 18:07:59 -05:00
|
|
|
// xfail-fast
|
2012-04-10 12:52:06 -05:00
|
|
|
// aux-build:cci_class_6.rs
|
2012-09-11 19:46:20 -05:00
|
|
|
extern mod cci_class_6;
|
2012-09-05 14:32:05 -05:00
|
|
|
use cci_class_6::kitties::*;
|
2012-04-10 12:52:06 -05:00
|
|
|
|
|
|
|
fn main() {
|
2012-06-29 18:26:56 -05:00
|
|
|
let nyan : cat<char> = cat::<char>(52u, 99, ~['p']);
|
2012-07-14 00:57:48 -05:00
|
|
|
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-07-14 00:57:48 -05:00
|
|
|
kitty.speak(~[~"meow", ~"mew", ~"purr", ~"chirp"]);
|
2012-04-10 12:52:06 -05:00
|
|
|
assert(kitty.meow_count() == 1004u);
|
|
|
|
}
|