diff --git a/src/lib.rs b/src/lib.rs index a6b10f7..19786ae 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -103,6 +103,10 @@ impl Timestamp { timestamp: self.timestamp + duration.as_millis() as i64, } } + + pub fn get(&self) -> i64 { + self.timestamp + } } pub struct Listener { diff --git a/tests/document_tests.rs b/tests/document_tests.rs index 54ea332..e74ca91 100644 --- a/tests/document_tests.rs +++ b/tests/document_tests.rs @@ -367,6 +367,9 @@ fn database_document_expiration() { .expect("document_expiration"); assert_eq!(doc_expiration.unwrap(), expiration); + let set_expiration = doc_expiration.unwrap().get(); + assert_eq!(set_expiration, expiration.get()); + // Check the document is still present after 1 second sleep(Duration::from_secs(1)); assert!(default_collection(db).get_document("foo").is_ok());