]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/estr-slice.rs
remove leftover obsolete string literals
[rust.git] / src / test / run-pass / estr-slice.rs
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.
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
12 pub fn main() {
13     let x = "hello";
14     let v = "hello";
15     let y : &str = "there";
16
17     println!("{}", x);
18     println!("{}", y);
19
20     assert_eq!(x[0], 'h' as u8);
21     assert_eq!(x[4], 'o' as u8);
22
23     let z : &str = "thing";
24     assert_eq!(v, x);
25     assert!(x != z);
26
27     let a = "aaaa";
28     let b = "bbbb";
29
30     let c = "cccc";
31     let cc = "ccccc";
32
33     println!("{}", a);
34
35     assert!(a < b);
36     assert!(a <= b);
37     assert!(a != b);
38     assert!(b >= a);
39     assert!(b > a);
40
41     println!("{}", b);
42
43     assert!(a < c);
44     assert!(a <= c);
45     assert!(a != c);
46     assert!(c >= a);
47     assert!(c > a);
48
49     println!("{}", c);
50
51     assert!(c < cc);
52     assert!(c <= cc);
53     assert!(c != cc);
54     assert!(cc >= c);
55     assert!(cc > c);
56
57     println!("{}", cc);
58 }