PageRenderTime 11ms CodeModel.GetById 2ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/src/test/run-pass/cast.rs

http://github.com/jruderman/rust
Rust | 16 lines | 12 code | 3 blank | 1 comment | 8 complexity | 28803223b58a11deac02e5f55546de37 MD5 | raw file
 1
 2
 3
 4// -*- rust -*-
 5fn main() {
 6    let i: int = 'Q' as int;
 7    assert (i == 0x51);
 8    let u: u32 = i as u32;
 9    assert (u == 0x51 as u32);
10    assert (u == 'Q' as u32);
11    assert (i as u8 == 'Q' as u8);
12    assert (i as u8 as i8 == 'Q' as u8 as i8);
13    assert (0x51 as char == 'Q');
14    assert (true == 1 as bool);
15    assert (0 as u32 == false as u32);
16}