-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(crypto): Add some basic snapshot testing in crypto crate
- Loading branch information
1 parent
667a8e6
commit 4e6c060
Showing
23 changed files
with
495 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...s/matrix_sdk_crypto__olm__group_sessions__sender_data__tests__snapshot_sender_data-2.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
source: crates/matrix-sdk-crypto/src/olm/group_sessions/sender_data.rs | ||
expression: "SenderData::UnknownDevice { legacy_session: true, owner_check_failed: false, }" | ||
--- | ||
{ | ||
"UnknownDevice": { | ||
"legacy_session": true | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...s/matrix_sdk_crypto__olm__group_sessions__sender_data__tests__snapshot_sender_data-3.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
source: crates/matrix-sdk-crypto/src/olm/group_sessions/sender_data.rs | ||
expression: "SenderData::DeviceInfo\n{\n device_keys:\n DeviceKeys::new(owned_user_id!(\"@foo:bar.baz\"), owned_device_id!(\"DEV\"),\n vec!(EventEncryptionAlgorithm::MegolmV1AesSha2,\n EventEncryptionAlgorithm::OlmV1Curve25519AesSha2),\n BTreeMap::from_iter(vec![(DeviceKeyId::from_parts(DeviceKeyAlgorithm::Ed25519,\n device_id!(\"ABCDEFGH\")),\n DeviceKey::Curve25519(Curve25519PublicKey::from_bytes([0u8; 32])),)]),\n Default::default(),), legacy_session: false,\n}" | ||
--- | ||
{ | ||
"DeviceInfo": { | ||
"device_keys": { | ||
"user_id": "@foo:bar.baz", | ||
"device_id": "DEV", | ||
"algorithms": [ | ||
"m.megolm.v1.aes-sha2", | ||
"m.olm.v1.curve25519-aes-sha2" | ||
], | ||
"keys": { | ||
"ed25519:ABCDEFGH": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" | ||
}, | ||
"signatures": {} | ||
}, | ||
"legacy_session": false | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
...s/matrix_sdk_crypto__olm__group_sessions__sender_data__tests__snapshot_sender_data-4.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
source: crates/matrix-sdk-crypto/src/olm/group_sessions/sender_data.rs | ||
expression: "SenderData::VerificationViolation(KnownSenderData\n{\n user_id: owned_user_id!(\"@foo:bar.baz\"), device_id:\n Some(owned_device_id!(\"DEV\")), master_key:\n Box::new(Ed25519PublicKey::from_slice(&[0u8; 32]).unwrap()),\n})" | ||
--- | ||
{ | ||
"VerificationViolation": { | ||
"user_id": "@foo:bar.baz", | ||
"device_id": "DEV", | ||
"master_key": [ | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0 | ||
] | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
...s/matrix_sdk_crypto__olm__group_sessions__sender_data__tests__snapshot_sender_data-5.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
source: crates/matrix-sdk-crypto/src/olm/group_sessions/sender_data.rs | ||
expression: "SenderData::SenderUnverified(KnownSenderData\n{\n user_id: owned_user_id!(\"@foo:bar.baz\"), device_id: None, master_key:\n Box::new(Ed25519PublicKey::from_slice(&[1u8; 32]).unwrap()),\n})" | ||
--- | ||
{ | ||
"SenderUnverified": { | ||
"user_id": "@foo:bar.baz", | ||
"device_id": null, | ||
"master_key": [ | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1 | ||
] | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
...s/matrix_sdk_crypto__olm__group_sessions__sender_data__tests__snapshot_sender_data-6.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
source: crates/matrix-sdk-crypto/src/olm/group_sessions/sender_data.rs | ||
expression: "SenderData::SenderVerified(KnownSenderData\n{\n user_id: owned_user_id!(\"@foo:bar.baz\"), device_id: None, master_key:\n Box::new(Ed25519PublicKey::from_slice(&[1u8; 32]).unwrap()),\n})" | ||
--- | ||
{ | ||
"SenderVerified": { | ||
"user_id": "@foo:bar.baz", | ||
"device_id": null, | ||
"master_key": [ | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1 | ||
] | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...ots/matrix_sdk_crypto__olm__group_sessions__sender_data__tests__snapshot_sender_data.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
source: crates/matrix-sdk-crypto/src/olm/group_sessions/sender_data.rs | ||
expression: "SenderData::UnknownDevice { legacy_session: false, owner_check_failed: true, }" | ||
--- | ||
{ | ||
"UnknownDevice": { | ||
"legacy_session": false, | ||
"owner_check_failed": true | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...atrix-sdk-crypto/src/snapshots/matrix_sdk_crypto__test__snapshot_decryption_settings.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
source: crates/matrix-sdk-crypto/src/lib.rs | ||
expression: "DecryptionSettings\n{ sender_device_trust_requirement: TrustRequirement::Untrusted, }" | ||
--- | ||
{ | ||
"sender_device_trust_requirement": "Untrusted" | ||
} |
5 changes: 5 additions & 0 deletions
5
...atrix-sdk-crypto/src/snapshots/matrix_sdk_crypto__test__snapshot_trust_requirement-2.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
source: crates/matrix-sdk-crypto/src/lib.rs | ||
expression: "TrustRequirement::CrossSignedOrLegacy" | ||
--- | ||
"CrossSignedOrLegacy" |
5 changes: 5 additions & 0 deletions
5
...atrix-sdk-crypto/src/snapshots/matrix_sdk_crypto__test__snapshot_trust_requirement-3.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
source: crates/matrix-sdk-crypto/src/lib.rs | ||
expression: "TrustRequirement::CrossSigned" | ||
--- | ||
"CrossSigned" |
5 changes: 5 additions & 0 deletions
5
.../matrix-sdk-crypto/src/snapshots/matrix_sdk_crypto__test__snapshot_trust_requirement.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
source: crates/matrix-sdk-crypto/src/lib.rs | ||
expression: "TrustRequirement::Untrusted" | ||
--- | ||
"Untrusted" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.