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

Function collect_spine

crates/kernel/src/expr.rs:790–799  ·  view source on GitHub ↗
(e: &KExpr<M>)

Source from the content-addressed store, hash-verified

788 fn const_hash() {
789 let c = AE::cnst(KId::new(mk_addr("Nat"), ()), Box::new([]));
790 assert_eq!(c.lbr(), 0);
791 assert_eq!(c.count_0(), 0);
792 }
793
794 #[test]
795 fn const_meta_name_does_not_affect_hash() {
796 // `id.name` is display-only metadata. Two `Const` nodes with the same
797 // `id.addr` (the actual identity) are content-equal regardless of
798 // their display names.
799 let a = ME::cnst(KId::new(mk_addr("Nat"), mk_name("Nat")), Box::new([]));
800 let b = ME::cnst(KId::new(mk_addr("Nat"), mk_name("Int")), Box::new([]));
801 assert_eq!(a, b);
802 }

Callers 1

fmt_exprFunction · 0.85

Calls 3

pushMethod · 0.80
cloneMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected