diff options
Diffstat (limited to 'database/src/test_shared.rs')
| -rw-r--r-- | database/src/test_shared.rs | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/database/src/test_shared.rs b/database/src/test_shared.rs index 81d2e60..4d06a1f 100644 --- a/database/src/test_shared.rs +++ b/database/src/test_shared.rs @@ -4,25 +4,33 @@ Copyright (C) 2026 metamuffin <metamuffin.org> */ -use jellyobject::{ObjectBuffer, fields}; +use jellyobject::{OBB, Object, fields}; fields! { - NAME: &str = b"name"; + NAME: str = b"name"; AGE: u32 = b"age1"; - FRIEND: &str = b"frnd"; + FRIEND: str = b"frnd"; } -pub(crate) fn new_bob() -> ObjectBuffer { - ObjectBuffer::new(&mut [ - (NAME.0, &"Bob"), - (AGE.0, &35_u32), - (FRIEND.0, &"Alice"), - (FRIEND.0, &"Charlie"), - ]) +pub(crate) fn new_bob() -> Box<Object> { + OBB::new() + .with(NAME, "Bob") + .with(AGE, 35) + .with(FRIEND, "Alice") + .with(FRIEND, "Charlie") + .finish() } -pub(crate) fn new_alice() -> ObjectBuffer { - ObjectBuffer::new(&mut [(NAME.0, &"Alice"), (AGE.0, &31_u32), (FRIEND.0, &"Bob")]) +pub(crate) fn new_alice() -> Box<Object> { + OBB::new() + .with(NAME, "Alice") + .with(AGE, 31) + .with(FRIEND, "Bob") + .finish() } -pub(crate) fn new_charlie() -> ObjectBuffer { - ObjectBuffer::new(&mut [(NAME.0, &"Charlie"), (AGE.0, &31_u32), (FRIEND.0, &"Bob")]) +pub(crate) fn new_charlie() -> Box<Object> { + OBB::new() + .with(NAME, "Charlie") + .with(AGE, 31) + .with(FRIEND, "Bob") + .finish() } |