Add a test for the `partial_eq` impls.
@@ -216,6 +216,40 @@ fn new_from_array() {
assert_eq!(vec3, []);
}
+#[test]
+fn partial_eq() {
+ assert_eq!(StaticVec::<i32, 0>::new(), [0; 0]);
+ assert_eq!(StaticVec::<i32, 0>::new(), []);
+ assert_eq!(StaticVec::<i32, 0>::new(), &[]);
+ assert_eq!(StaticVec::<i32, 0>::new(), &mut []);
+ assert_eq!(StaticVec::<i32, 0>::new(), StaticVec::<i32, 0>::new());
+ assert_eq!(StaticVec::<i32, 0>::new(), &StaticVec::<i32, 0>::new());
+ assert_eq!(StaticVec::<i32, 0>::new(), &mut StaticVec::<i32, 0>::new());
+ //assert_eq! is written in a way that's limited by LengthAtMost32, so I can't
+ //use it for the next part.
+ if staticvec![1; 64] != [1; 64] {
+ panic!();
+ }
+ if staticvec![1; 64] != [1; 64] {
+ panic!();
+ }
+ if staticvec![1; 64] != &[1; 64] {
+ panic!();
+ }
+ if staticvec![1; 64] != &mut [1; 64] {
+ panic!();
+ }
+ if staticvec![1; 64] != staticvec![1; 64] {
+ panic!();
+ }
+ if staticvec![1; 64] != &staticvec![1; 64] {
+ panic!();
+ }
+ if staticvec![1; 64] != &mut staticvec![1; 64] {
+ panic!();
+ }
+}
+
#[test]
fn pop() {
let mut vec = staticvec![1, 2, 3];
