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