()
| 219 | |
| 220 | #[test] |
| 221 | fn put_then_get_round_trips() { |
| 222 | let dir = scratch_dir("roundtrip"); |
| 223 | let mut cache = PublicKeyCache::open_at(dir.as_path()); |
| 224 | cache.put(SERVER, "lee", KEY, "active"); |
| 225 | |
| 226 | let hit = cache.get(SERVER, "lee").unwrap(); |
| 227 | assert_eq!(hit.public_key, KEY); |
| 228 | assert!(hit.source_line().contains("local key cache")); |
| 229 | |
| 230 | // And a re-open from disk sees the persisted entry. |
| 231 | let reopened = PublicKeyCache::open_at(dir.as_path()); |
| 232 | assert_eq!( |
| 233 | reopened.get(SERVER, "lee").map(|c| c.public_key).as_deref(), |
| 234 | Some(KEY.into()) |
| 235 | ); |
| 236 | } |
| 237 | |
| 238 | #[test] |
| 239 | fn same_name_on_another_server_is_a_miss() { |
nothing calls this directly
no test coverage detected