MCPcopy Create free account
hub / github.com/argumentcomputer/ix / test_roundtrip_with_sharing

Function test_roundtrip_with_sharing

crates/ixon/src/sharing.rs:1062–1076  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1060
1061 #[test]
1062 fn test_roundtrip_with_sharing() {
1063 use crate::serialize::{get_expr, put_expr};
1064
1065 // Create a simple expression with potential sharing
1066 let var0 = Expr::var(0);
1067 let var1 = Expr::var(1);
1068 let app = Expr::app(var0, var1);
1069
1070 // Serialize and deserialize without sharing
1071 let mut buf = Vec::new();
1072 put_expr(&app, &mut buf);
1073 let recovered = get_expr(&mut buf.as_slice()).unwrap();
1074
1075 assert_eq!(app.as_ref(), recovered.as_ref());
1076 }
1077}

Callers

nothing calls this directly

Calls 5

put_exprFunction · 0.85
get_exprFunction · 0.85
as_sliceMethod · 0.80
varFunction · 0.50
appFunction · 0.50

Tested by

no test coverage detected