Files
alkane-os/vendor/unicode-ident/tests/static_size.rs
T
x ad31cfbafa Vendor flare-ui v0.2.9 and prove the schema-driven UI in an image
Spike, not the final UI: it answers whether flare-ui can drive Alkane OS's
on-box pages, and what it costs.

What works:

- schema/alkane-bb.json authors the sidebar as data (3 sections, 14 tabs);
- src/bin/ui-spike.rs renders it through flare_ui::nav + flare_ui::shell, so
  the unified sidebar, ordering and surface filtering come from the schema
  rather than from hand-written HTML;
- the render uses the shared bf- design tokens, the same ones the rest of the
  suite uses.

Size, measured rather than assumed (armv7, release, stripped):

  ui-baseline   323 KiB   (maud + serde_json, no flare-ui)
  ui-spike      771 KiB   (flare-ui + wschema + sha2)
  marginal      448 KiB

Vendoring: third-party/flare-ui is the full v0.2.9 tree pinned in
flare-ui/flare-ui.lock (a partial archive does not compile, since the crate
include_str!s assets from dash-editor/). vendor/ is re-generated as a cargo
directory source with the new registry dependencies (maud, sha2, typenum,
digest, generic-array, block-buffer, crypto-common, cfg-if, etc.) so the build
still works offline. third-party/README.md records how to re-pin.
2026-11-04 14:06:25 -06:00

96 lines
2.4 KiB
Rust

#![allow(clippy::let_underscore_untyped, clippy::unreadable_literal)]
use std::mem::size_of_val;
#[test]
fn test_size() {
#[allow(dead_code)]
#[path = "../src/tables.rs"]
mod tables;
let size = size_of_val(&tables::ASCII_START)
+ size_of_val(&tables::ASCII_CONTINUE)
+ size_of_val(&tables::TRIE_START)
+ size_of_val(&tables::TRIE_CONTINUE)
+ size_of_val(&tables::LEAF);
assert_eq!(10408, size);
}
#[test]
fn test_xid_size() {
#[deny(dead_code)]
#[path = "tables/mod.rs"]
mod tables;
let size = size_of_val(tables::XID_START) + size_of_val(tables::XID_CONTINUE);
assert_eq!(12184, size);
let _ = tables::BY_NAME;
}
#[cfg(target_pointer_width = "64")]
#[test]
fn test_trieset_size() {
#[deny(dead_code)]
#[allow(clippy::redundant_static_lifetimes)]
#[path = "trie/trie.rs"]
mod trie;
let ucd_trie::TrieSet {
tree1_level1,
tree2_level1,
tree2_level2,
tree3_level1,
tree3_level2,
tree3_level3,
} = *trie::XID_START;
let start_size = size_of_val(trie::XID_START)
+ size_of_val(tree1_level1)
+ size_of_val(tree2_level1)
+ size_of_val(tree2_level2)
+ size_of_val(tree3_level1)
+ size_of_val(tree3_level2)
+ size_of_val(tree3_level3);
let ucd_trie::TrieSet {
tree1_level1,
tree2_level1,
tree2_level2,
tree3_level1,
tree3_level2,
tree3_level3,
} = *trie::XID_CONTINUE;
let continue_size = size_of_val(trie::XID_CONTINUE)
+ size_of_val(tree1_level1)
+ size_of_val(tree2_level1)
+ size_of_val(tree2_level2)
+ size_of_val(tree3_level1)
+ size_of_val(tree3_level2)
+ size_of_val(tree3_level3);
assert_eq!(10752, start_size + continue_size);
let _ = trie::BY_NAME;
}
#[test]
fn test_fst_size() {
let xid_start_fst = include_bytes!("fst/xid_start.fst");
let xid_continue_fst = include_bytes!("fst/xid_continue.fst");
let size = xid_start_fst.len() + xid_continue_fst.len();
assert_eq!(148706, size);
}
#[test]
fn test_roaring_size() {
#[path = "roaring/mod.rs"]
mod roaring;
let xid_start_bitmap = roaring::xid_start_bitmap();
let xid_continue_bitmap = roaring::xid_continue_bitmap();
let size = xid_start_bitmap.serialized_size() + xid_continue_bitmap.serialized_size();
assert_eq!(66104, size);
}