diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-01 18:14:16 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-01 18:14:16 +0100 |
| commit | 55032d2de36b08692d39cc94c4f2da317b3e2eb7 (patch) | |
| tree | 2ace8ef541e1ec211ff703c5050027c13ba56759 /tests | |
| parent | v4.0.3: lobby and history screens behind commands (diff) | |
| download | zagan-bet-55032d2de36b08692d39cc94c4f2da317b3e2eb7.tar.gz zagan-bet-55032d2de36b08692d39cc94c4f2da317b3e2eb7.zip | |
v4.0.4: move the client transport and TOFU into the library
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/tofu.rs | 13 |
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] | ||
| 138 | fn 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 | } | ||
