Rollup merge of #32186 - srinivasreddy:libcoretest, r=steveklabnik

cleanup int suffixes in libcoretest
This commit is contained in:
Manish Goregaokar 2016-03-12 02:41:27 +05:30
commit c8578c1f40
5 changed files with 23 additions and 23 deletions

View File

@ -53,7 +53,7 @@ mod debug_struct {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fmt.debug_struct("Foo")
.field("bar", &true)
.field("baz", &format_args!("{}/{}", 10i32, 20i32))
.field("baz", &format_args!("{}/{}", 10, 20))
.finish()
}
}
@ -75,7 +75,7 @@ mod debug_struct {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fmt.debug_struct("Foo")
.field("bar", &true)
.field("baz", &format_args!("{}/{}", 10i32, 20i32))
.field("baz", &format_args!("{}/{}", 10, 20))
.finish()
}
}
@ -150,7 +150,7 @@ mod debug_tuple {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fmt.debug_tuple("Foo")
.field(&true)
.field(&format_args!("{}/{}", 10i32, 20i32))
.field(&format_args!("{}/{}", 10, 20))
.finish()
}
}
@ -172,7 +172,7 @@ mod debug_tuple {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fmt.debug_tuple("Foo")
.field(&true)
.field(&format_args!("{}/{}", 10i32, 20i32))
.field(&format_args!("{}/{}", 10, 20))
.finish()
}
}
@ -247,7 +247,7 @@ mod debug_map {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fmt.debug_map()
.entry(&"bar", &true)
.entry(&10i32, &format_args!("{}/{}", 10i32, 20i32))
.entry(&10, &format_args!("{}/{}", 10, 20))
.finish()
}
}
@ -269,7 +269,7 @@ mod debug_map {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fmt.debug_map()
.entry(&"bar", &true)
.entry(&10i32, &format_args!("{}/{}", 10i32, 20i32))
.entry(&10, &format_args!("{}/{}", 10, 20))
.finish()
}
}
@ -348,7 +348,7 @@ mod debug_set {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fmt.debug_set()
.entry(&true)
.entry(&format_args!("{}/{}", 10i32, 20i32))
.entry(&format_args!("{}/{}", 10, 20))
.finish()
}
}
@ -370,7 +370,7 @@ mod debug_set {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fmt.debug_set()
.entry(&true)
.entry(&format_args!("{}/{}", 10i32, 20i32))
.entry(&format_args!("{}/{}", 10, 20))
.finish()
}
}
@ -445,7 +445,7 @@ mod debug_list {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fmt.debug_list()
.entry(&true)
.entry(&format_args!("{}/{}", 10i32, 20i32))
.entry(&format_args!("{}/{}", 10, 20))
.finish()
}
}
@ -467,7 +467,7 @@ mod debug_list {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fmt.debug_list()
.entry(&true)
.entry(&format_args!("{}/{}", 10i32, 20i32))
.entry(&format_args!("{}/{}", 10, 20))
.finish()
}
}

View File

@ -677,7 +677,7 @@ fn test_rev() {
#[test]
fn test_cloned() {
let xs = [2u8, 4, 6, 8];
let xs = [2, 4, 6, 8];
let mut it = xs.iter().cloned();
assert_eq!(it.len(), 4);
@ -861,8 +861,8 @@ fn test_range() {
assert_eq!((-10..-1).size_hint(), (9, Some(9)));
assert_eq!((-1..-10).size_hint(), (0, Some(0)));
assert_eq!((-70..58i8).size_hint(), (128, Some(128)));
assert_eq!((-128..127i8).size_hint(), (255, Some(255)));
assert_eq!((-70..58).size_hint(), (128, Some(128)));
assert_eq!((-128..127).size_hint(), (255, Some(255)));
assert_eq!((-2..isize::MAX).size_hint(),
(isize::MAX as usize + 2, Some(isize::MAX as usize + 2)));
}
@ -1013,7 +1013,7 @@ fn bench_max_by_key2(b: &mut Bencher) {
array.iter().enumerate().max_by_key(|&(_, item)| item).unwrap().0
}
let mut data = vec![0i32; 1638];
let mut data = vec![0; 1638];
data[514] = 9999;
b.iter(|| max_index_iter(&data));

View File

@ -208,11 +208,11 @@ mod tests {
fn test_pow() {
let mut r = 2 as $T;
assert_eq!(r.pow(2u32), 4 as $T);
assert_eq!(r.pow(0u32), 1 as $T);
assert_eq!(r.pow(2), 4 as $T);
assert_eq!(r.pow(0), 1 as $T);
r = -2 as $T;
assert_eq!(r.pow(2u32), 4 as $T);
assert_eq!(r.pow(3u32), -8 as $T);
assert_eq!(r.pow(2), 4 as $T);
assert_eq!(r.pow(3), -8 as $T);
}
}

View File

@ -99,8 +99,8 @@ mod tests {
#[test]
fn test_leading_plus() {
assert_eq!("+127".parse::<u8>().ok(), Some(127u8));
assert_eq!("+9223372036854775807".parse::<i64>().ok(), Some(9223372036854775807i64));
assert_eq!("+127".parse::<u8>().ok(), Some(127));
assert_eq!("+9223372036854775807".parse::<i64>().ok(), Some(9223372036854775807));
}
#[test]

View File

@ -251,7 +251,7 @@ fn test_collect() {
#[test]
fn test_cloned() {
let val = 1u32;
let val = 1;
let val_ref = &val;
let opt_none: Option<&'static u32> = None;
let opt_ref = Some(&val);
@ -263,10 +263,10 @@ fn test_cloned() {
// Immutable ref works
assert_eq!(opt_ref.clone(), Some(&val));
assert_eq!(opt_ref.cloned(), Some(1u32));
assert_eq!(opt_ref.cloned(), Some(1));
// Double Immutable ref works
assert_eq!(opt_ref_ref.clone(), Some(&val_ref));
assert_eq!(opt_ref_ref.clone().cloned(), Some(&val));
assert_eq!(opt_ref_ref.cloned().cloned(), Some(1u32));
assert_eq!(opt_ref_ref.cloned().cloned(), Some(1));
}