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