Re-added accidentally removed test method.
Also fixed indentation.
This commit is contained in:
+2
-2
@@ -44,7 +44,7 @@ impl<A: Array<Item=u8>> ArrayString<A> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Create a new `ArrayString` from a string slice.
|
||||
///
|
||||
/// Capacity is inferred from the type parameter.
|
||||
@@ -62,7 +62,7 @@ impl<A: Array<Item=u8>> ArrayString<A> {
|
||||
try!(arraystr.push_str(s));
|
||||
Ok(arraystr)
|
||||
}
|
||||
|
||||
|
||||
/// Return the capacity of the `ArrayString`.
|
||||
///
|
||||
/// ```
|
||||
|
||||
+12
-1
@@ -25,6 +25,17 @@ fn test_simple() {
|
||||
assert_eq!(sum_len, 8);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_u16_index() {
|
||||
const N: usize = 4096;
|
||||
let mut vec: ArrayVec<[_; N]> = ArrayVec::new();
|
||||
for _ in 0..N {
|
||||
assert!(vec.push(1u8).is_none());
|
||||
}
|
||||
assert!(vec.push(0).is_some());
|
||||
assert_eq!(vec.len(), N);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_iter() {
|
||||
let mut iter = ArrayVec::from([1, 2, 3]).into_iter();
|
||||
@@ -284,7 +295,7 @@ fn test_string() {
|
||||
Ok(())
|
||||
}();
|
||||
assert!(t.is_err());
|
||||
|
||||
|
||||
// Test `from` constructor
|
||||
let u = ArrayString::<[_; 11]>::from(text).unwrap();
|
||||
assert_eq!(&u, text);
|
||||
|
||||
Reference in New Issue
Block a user