summaryrefslogtreecommitdiffstats
path: root/tests/tofu.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/tofu.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/tofu.rs b/tests/tofu.rs
index b644cc4..a26995f 100644
--- a/tests/tofu.rs
+++ b/tests/tofu.rs
@@ -133,3 +133,16 @@ fn fingerprint_roundtrip_in_client_db() {
133 client_database::forget_host(&conn, "host1").unwrap(); 133 client_database::forget_host(&conn, "host1").unwrap();
134 assert_eq!(client_database::get_fingerprint(&conn, "host1"), None); 134 assert_eq!(client_database::get_fingerprint(&conn, "host1"), None);
135} 135}
136
137#[test]
138fn a_changed_key_error_names_both_fingerprints() {
139 let error = zagan_bet::client::transport::TransportError::KeyChanged {
140 expected: "aaaa".to_string(),
141 observed: "bbbb".to_string(),
142 };
143 let text = error.to_string();
144
145 assert!(text.contains("HOST KEY CHANGED"), "{text}");
146 assert!(text.contains("aaaa"), "{text}");
147 assert!(text.contains("bbbb"), "{text}");
148}