aboutsummaryrefslogtreecommitdiff
path: root/database/src/test_shared.rs
blob: 81d2e60cb164ed04b56ab54eb07aceed64d20391 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
    This file is part of jellything (https://codeberg.org/metamuffin/jellything)
    which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
    Copyright (C) 2026 metamuffin <metamuffin.org>
*/

use jellyobject::{ObjectBuffer, fields};

fields! {
    NAME: &str = b"name";
    AGE: u32 = b"age1";
    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_alice() -> ObjectBuffer {
    ObjectBuffer::new(&mut [(NAME.0, &"Alice"), (AGE.0, &31_u32), (FRIEND.0, &"Bob")])
}
pub(crate) fn new_charlie() -> ObjectBuffer {
    ObjectBuffer::new(&mut [(NAME.0, &"Charlie"), (AGE.0, &31_u32), (FRIEND.0, &"Bob")])
}