]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/class-poly-methods-cross-crate.rs
Replace all ~"" with "".to_owned()
[rust.git] / src / test / run-pass / class-poly-methods-cross-crate.rs
1 // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // aux-build:cci_class_6.rs
12 extern crate cci_class_6;
13 use cci_class_6::kitties::cat;
14
15 pub fn main() {
16   let mut nyan : cat<char> = cat::<char>(52u, 99, vec!('p'));
17   let mut kitty = cat(1000u, 2, vec!("tabby".to_owned()));
18   assert_eq!(nyan.how_hungry, 99);
19   assert_eq!(kitty.how_hungry, 2);
20   nyan.speak(vec!(1u,2u,3u));
21   assert_eq!(nyan.meow_count(), 55u);
22   kitty.speak(vec!("meow".to_owned(), "mew".to_owned(), "purr".to_owned(), "chirp".to_owned()));
23   assert_eq!(kitty.meow_count(), 1004u);
24 }