Skip to content

Commit

Permalink
Add PartialEq and Eq to Entry and improve entry tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarema committed Aug 23, 2024
1 parent 53749df commit ce8e7e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion async-nats/src/jetstream/kv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,7 @@ impl futures::Stream for Keys {
}

/// An entry in a key-value bucket.
#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Entry {
/// Name of the bucket the entry is in.
pub bucket: String,
Expand Down
3 changes: 3 additions & 0 deletions async-nats/tests/kv_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ mod kv {

let value = kv.entry_for_revision("key", 1).await.unwrap();
assert_eq!(from_utf8(&value.unwrap().value).unwrap(), "data");

let value = kv.entry_for_revision("key", 250).await.unwrap();
assert!(value.is_none());
}

#[tokio::test]
Expand Down

0 comments on commit ce8e7e9

Please sign in to comment.