Add additional test cases to test all arities of tuple; And remove type suffix - i32 on integers

This commit is contained in:
Srinivas Reddy Thatiparthy 2016-06-11 22:28:17 +05:30
parent 7d8e6dd3bf
commit fa91c14bc0
1 changed files with 18 additions and 8 deletions

View File

@ -46,15 +46,25 @@ impl_tuple_slice!((T, T, T, T, T, T, T, T), 8);
#[test]
fn test_sliced_tuples() {
let t2 = (100i32, 101i32);
assert_eq!(t2.as_slice(), &[100i32, 101i32]);
let t2 = (100, 101);
assert_eq!(t2.as_slice(), &[100, 101]);
let t3 = (102i32, 103i32, 104i32);
assert_eq!(t3.as_slice(), &[102i32, 103i32, 104i32]);
let t3 = (102, 103, 104);
assert_eq!(t3.as_slice(), &[102, 103, 104]);
let t4 = (105i32, 106i32, 107i32, 108i32);
assert_eq!(t4.as_slice(), &[105i32, 106i32, 107i32, 108i32]);
let t4 = (105, 106, 107, 108);
assert_eq!(t4.as_slice(), &[105, 106, 107, 108]);
let t5 = (109, 110, 111, 112, 113);
assert_eq!(t5.as_slice(), &[109, 110, 111, 112, 113]);
let t6 = (114, 115, 116, 117, 118, 119);
assert_eq!(t6.as_slice(), &[114, 115, 116, 117, 118, 119]);
let t7 = (120, 121, 122, 123, 124, 125, 126);
assert_eq!(t7.as_slice(), &[120, 121, 122, 123, 124, 125, 126]);
let t8 = (127, 128, 129, 130, 131, 132, 133, 134);
assert_eq!(t8.as_slice(), &[127, 128, 129, 130, 131, 132, 133, 134]);
let t5 = (109i32, 110i32, 111i32, 112i32, 113i32);
assert_eq!(t5.as_slice(), &[109i32, 110i32, 111i32, 112i32, 113i32]);
}