()
| 403 | |
| 404 | #[test] |
| 405 | fn telescope_lam_byte_boundaries() { |
| 406 | for (n, tag_bytes) in |
| 407 | [(1u64, 1), (7, 1), (8, 2), (255, 2), (256, 3), (500, 3)] |
| 408 | { |
| 409 | let ty = Expr::var(1); |
| 410 | let mut expr: Arc<Expr> = Expr::var(0); |
| 411 | for _ in 0..n { |
| 412 | expr = Expr::lam(ty.clone(), expr); |
| 413 | } |
| 414 | let mut buf = Vec::new(); |
| 415 | put_expr(expr.as_ref(), &mut buf); |
| 416 | assert_eq!(buf.len(), tag_bytes + (n as usize) + 1); |
| 417 | assert!(expr_roundtrip(&expr)); |
| 418 | } |
| 419 | } |
| 420 | |
| 421 | #[test] |
| 422 | fn expr_and_constant_flags_unique() { |