]>
Commit | Line | Data |
---|---|---|
b7449926 | 1 | // run-pass |
223e47cc LB |
2 | // This file is intended to test only that methods are automatically |
3 | // reachable for each numeric type, for each exported impl, with no imports | |
4 | // necessary. Testing the methods of the impls is done within the source | |
5 | // file for each numeric type. | |
1a4d82fc JJ |
6 | |
7 | use std::ops::Add; | |
1a4d82fc | 8 | |
223e47cc LB |
9 | pub fn main() { |
10 | // ints | |
11 | // num | |
85aaf69f SL |
12 | assert_eq!(15_isize.add(6_isize), 21_isize); |
13 | assert_eq!(15_i8.add(6i8), 21_i8); | |
14 | assert_eq!(15_i16.add(6i16), 21_i16); | |
15 | assert_eq!(15_i32.add(6i32), 21_i32); | |
16 | assert_eq!(15_i64.add(6i64), 21_i64); | |
223e47cc LB |
17 | |
18 | // uints | |
19 | // num | |
85aaf69f SL |
20 | assert_eq!(15_usize.add(6_usize), 21_usize); |
21 | assert_eq!(15_u8.add(6u8), 21_u8); | |
22 | assert_eq!(15_u16.add(6u16), 21_u16); | |
23 | assert_eq!(15_u32.add(6u32), 21_u32); | |
24 | assert_eq!(15_u64.add(6u64), 21_u64); | |
223e47cc | 25 | } |