aboutsummaryrefslogtreecommitdiff
path: root/database/src/test_shared.rs
blob: fbd9501938f74994eebf0982c5f5c171e17906a4 (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, Registry, fields};
use std::sync::LazyLock;

pub static TAGREG: LazyLock<Registry> = LazyLock::new(|| {
    let mut reg = Registry::default();
    register_fields(&mut reg);
    reg
});
fields! {
    NAME: &str = 15 "name";
    AGE: u32 = 13 "age";
    FRIEND: &str = 54321 "friend";
}

pub(crate) fn new_bob() -> ObjectBuffer {
    ObjectBuffer::new(&mut [
        (NAME.0, &"Bob"),
        (AGE.0, &35_u32),
        (FRIEND.0, &"Alice"),
        (FRIEND.0, &"Charlie"),
    ])
}