1 // Copyright 2012 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.
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.
11 #![feature(collections)]
13 use std
::string
::String
;
15 fn test_stack_assign() {
16 let s
: String
= "a".to_string();
17 println
!("{}", s
.clone());
18 let t
: String
= "a".to_string();
20 let u
: String
= "b".to_string();
24 fn test_heap_lit() { "a big string".to_string(); }
26 fn test_heap_assign() {
27 let s
: String
= "a big ol' string".to_string();
28 let t
: String
= "a big ol' string".to_string();
30 let u
: String
= "a bad ol' string".to_string();
35 let s
= "a big ol' string".to_string();
40 let mut s
= String
::new();
44 let mut s
= String
::from("a");
46 println
!("{}", s
.clone());
49 let mut s
= String
::from("c");
51 assert_eq
!(s
, "coffee");
54 assert_eq
!(s
, "coffee&tea");