mirror of
https://github.com/Start9Labs/patch-db.git
synced 2026-03-26 10:21:53 +00:00
@@ -3,10 +3,11 @@ use super::*;
|
|||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn basic() {
|
async fn basic() {
|
||||||
let db = PatchDb::open("test.db").await.unwrap();
|
let db = PatchDb::open("test.db").await.unwrap();
|
||||||
let _rev = db
|
db.put(&JsonPointer::<&'static str>::default(), &Sample{a: "test1".to_string(), b: Child{a: "test2".to_string(), b: 4} }).await.unwrap();
|
||||||
.put(&JsonPointer::<&'static str>::default(), &"test")
|
let ptr: JsonPointer = "/b/b".parse().unwrap();
|
||||||
.await
|
db.put(&ptr, &"hello").await.unwrap();
|
||||||
.unwrap();
|
let get_res: Value = db.get(&ptr).await.unwrap();
|
||||||
|
assert_eq!(get_res, "hello");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, serde::Deserialize, serde::Serialize)]
|
#[derive(Debug, serde::Deserialize, serde::Serialize)]
|
||||||
|
|||||||
Reference in New Issue
Block a user