MCPcopy Create free account
hub / github.com/ciphermodelabs/ciphercore / test_get_bytes

Function test_get_bytes

ciphercore-base/src/data_values.rs:1683–1694  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 1

access_bytesMethod · 0.80

Tested by

no test coverage detected