()
| 182 | |
| 183 | #[test] |
| 184 | fn display_unknown_const() { |
| 185 | let addr = Address::hash(b"some-constant"); |
| 186 | let e: TcError<Anon> = TcError::UnknownConst(addr.clone()); |
| 187 | let s = format!("{e}"); |
| 188 | assert!(s.starts_with("unknown constant")); |
| 189 | // The display uses `{:.12}` — precision truncates the hex. Verify the |
| 190 | // first 12 chars of the hex appear. |
| 191 | let hex = addr.hex(); |
| 192 | assert!(s.contains(&hex[..12])); |
| 193 | } |
| 194 | |
| 195 | #[test] |
| 196 | fn display_univ_param_mismatch() { |