()
| 1681 | |
| 1682 | #[test] |
| 1683 | fn test_get_bytes() { |
| 1684 | let v = Value::from_bytes(vec![0, 1, 2, 3]); |
| 1685 | v.access_bytes(|bytes| { |
| 1686 | assert_eq!(bytes, vec![0, 1, 2, 3]); |
| 1687 | Ok(()) |
| 1688 | }) |
| 1689 | .unwrap(); |
| 1690 | |
| 1691 | let v = Value::from_vector(vec![Value::from_bytes(vec![0]), Value::from_bytes(vec![0])]); |
| 1692 | let e = catch_unwind(AssertUnwindSafe(|| v.access_bytes(|_| Ok(())))); |
| 1693 | assert!(e.is_err()); |
| 1694 | } |
| 1695 | |
| 1696 | #[test] |
| 1697 | fn test_serialization() { |
nothing calls this directly
no test coverage detected