Skip to content

Commit

Permalink
Removed some of the integration tests and refactor the remaining to u…
Browse files Browse the repository at this point in the history
…se common code. (#3)

Removed some of the integration tests and refactor remaining ones to use common code.
  • Loading branch information
radumarias authored Aug 5, 2024
1 parent 60baf29 commit 81de6ca
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
44 changes: 22 additions & 22 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
//!
//! Here are examples of how to use the library. You can see more in [examples](../examples) folder and read about in the dedicated [README](../examples/README.md).
//!
//! This example demonstrates a simulated device and reader interaction.
//! This example demonstrates a simulated device and reader interaction.
//! The reader requests the `age_over_21` element, and the device responds with that value.
//! The flow is something like this:
//!
//! ```text
//! +---------------------+ +----------------------+
//! +---------------------+ +----------------------+
//! | | | |
//! | | | |
//! | Device | | Reader |
Expand Down Expand Up @@ -87,15 +87,15 @@
//!
//! ```text
//!
//! +---------+
//! | |
//! | |
//! | User |
//! | |
//! | |
//! +---+-----+
//! |
//! |
//! +---------+
//! | |
//! | |
//! | User |
//! | |
//! | |
//! +---+-----+
//! |
//! |
//! +----------------------------------------------------v--------------------------------------------------------------+
//! | Device |
//! | |
Expand Down Expand Up @@ -163,16 +163,16 @@
//! | | +-----------------------------------------+-------------------------------+ | |
//! | | handle_response | |
//! +-------+------------------------------------------------+---------------------------------------------+------------+
//! | | |
//! | +-------v-------+ |
//! | | Reader | |
//! | | | |
//! | | | |
//! +----------------------------------------> +-------------------------------------+
//! | |
//! | |
//! | |
//! +---------------+
//! | | |
//! | +-------v-------+ |
//! | | Reader | |
//! | | | |
//! | | | |
//! +----------------------------------------> +-------------------------------------+
//! | |
//! | |
//! | |
//! +---------------+
//! ```
//!
//! The reader is simulated in `common`
Expand All @@ -190,7 +190,7 @@
//! From the reader's perspective, the flow is simpler:
//!
//! ```text
//! +--------+
//! +--------+
//! | |
//! | User |
//! | |
Expand Down
4 changes: 2 additions & 2 deletions tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ pub fn create_response(
.into_iter()
.collect(),
)]
.into_iter()
.collect();
.into_iter()
.collect();
session_manager.prepare_response(&requested_items, permitted_items);
let (_, sign_payload) = session_manager.get_next_signature_payload().unwrap();
let signature: p256::ecdsa::Signature = key.sign(sign_payload);
Expand Down

0 comments on commit 81de6ca

Please sign in to comment.