usesuper::*;#[test]fnfrom_ip_errors(){usecrate::ReadError::*;//slice length error
assert_matches!(SlicedPacket::from_ip(&[]),Err(UnexpectedEndOfSlice(1)));//bad protocol number
for i in0u8..std::u8::MAX{if i >>4!=4&&
i >>4!=6{assert_matches!(SlicedPacket::from_ip(&[i]),Err(IpUnsupportedVersion(_)));}}}