Skip to content

Commit 9887e9b

Browse files
fix: redact PGP RSA binary lengths in snapshot for cross-platform compat
RSA PGP key binary lengths may differ between Windows and Linux due to platform-specific PGP key serialization. Redact these values to prevent cross-platform snapshot failures during mutation testing. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent b63feb1 commit 9887e9b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

crates/uselesskey-pgp/tests/snapshots/snapshots_pgp__pgp_rsa_2048_shape.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ user_id: snapshot-rsa2048 <snapshot-rsa2048@uselesskey.test>
99
fingerprint_len: 40
1010
private_armored_starts_with: "-----BEGIN PGP PRIVATE KEY BLOCK-----"
1111
public_armored_starts_with: "-----BEGIN PGP PUBLIC KEY BLOCK-----"
12-
private_binary_len: 1303
13-
public_binary_len: 652
12+
private_binary_len: "[RSA_PRIV_LEN]"
13+
public_binary_len: "[RSA_PUB_LEN]"

crates/uselesskey-pgp/tests/snapshots_pgp.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ fn snapshot_pgp_rsa_2048_shape() {
6060
public_binary_len: kp.public_key_binary().len(),
6161
};
6262

63-
insta::assert_yaml_snapshot!("pgp_rsa_2048_shape", result);
63+
insta::assert_yaml_snapshot!("pgp_rsa_2048_shape", result, {
64+
".private_binary_len" => "[RSA_PRIV_LEN]",
65+
".public_binary_len" => "[RSA_PUB_LEN]",
66+
});
6467
}
6568

6669
#[test]

0 commit comments

Comments
 (0)