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.
281 lines
5.6 KiB
TOML
281 lines
5.6 KiB
TOML
# NOTE: We define a number of tests where the *match* kind is 'leftmost-first'
|
|
# but the *search* kind is 'overlapping'. This is a somewhat nonsensical
|
|
# combination and can produce odd results. Nevertheless, those results should
|
|
# be consistent so we test them here. (At the time of writing this note, I
|
|
# hadn't yet decided whether to make 'leftmost-first' with 'overlapping' result
|
|
# in unspecified behavior.)
|
|
|
|
# This demonstrates how a full overlapping search is obvious quadratic. This
|
|
# regex reports a match for every substring in the haystack.
|
|
[[test]]
|
|
name = "ungreedy-dotstar-matches-everything-100"
|
|
regex = [".*?"]
|
|
haystack = "zzz"
|
|
matches = [
|
|
{ id = 0, span = [0, 0] },
|
|
{ id = 0, span = [1, 1] },
|
|
{ id = 0, span = [0, 1] },
|
|
{ id = 0, span = [2, 2] },
|
|
{ id = 0, span = [1, 2] },
|
|
{ id = 0, span = [0, 2] },
|
|
{ id = 0, span = [3, 3] },
|
|
{ id = 0, span = [2, 3] },
|
|
{ id = 0, span = [1, 3] },
|
|
{ id = 0, span = [0, 3] },
|
|
]
|
|
match-kind = "all"
|
|
search-kind = "overlapping"
|
|
|
|
[[test]]
|
|
name = "greedy-dotstar-matches-everything-100"
|
|
regex = [".*"]
|
|
haystack = "zzz"
|
|
matches = [
|
|
{ id = 0, span = [0, 0] },
|
|
{ id = 0, span = [1, 1] },
|
|
{ id = 0, span = [0, 1] },
|
|
{ id = 0, span = [2, 2] },
|
|
{ id = 0, span = [1, 2] },
|
|
{ id = 0, span = [0, 2] },
|
|
{ id = 0, span = [3, 3] },
|
|
{ id = 0, span = [2, 3] },
|
|
{ id = 0, span = [1, 3] },
|
|
{ id = 0, span = [0, 3] },
|
|
]
|
|
match-kind = "all"
|
|
search-kind = "overlapping"
|
|
|
|
[[test]]
|
|
name = "repetition-plus-leftmost-first-100"
|
|
regex = 'a+'
|
|
haystack = "aaa"
|
|
matches = [[0, 1], [1, 2], [0, 2], [2, 3], [1, 3], [0, 3]]
|
|
match-kind = "leftmost-first"
|
|
search-kind = "overlapping"
|
|
|
|
[[test]]
|
|
name = "repetition-plus-leftmost-first-110"
|
|
regex = '☃+'
|
|
haystack = "☃☃☃"
|
|
matches = [[0, 3], [3, 6], [0, 6], [6, 9], [3, 9], [0, 9]]
|
|
match-kind = "leftmost-first"
|
|
search-kind = "overlapping"
|
|
|
|
[[test]]
|
|
name = "repetition-plus-all-100"
|
|
regex = 'a+'
|
|
haystack = "aaa"
|
|
matches = [[0, 1], [1, 2], [0, 2], [2, 3], [1, 3], [0, 3]]
|
|
match-kind = "all"
|
|
search-kind = "overlapping"
|
|
|
|
[[test]]
|
|
name = "repetition-plus-all-110"
|
|
regex = '☃+'
|
|
haystack = "☃☃☃"
|
|
matches = [[0, 3], [3, 6], [0, 6], [6, 9], [3, 9], [0, 9]]
|
|
match-kind = "all"
|
|
search-kind = "overlapping"
|
|
|
|
[[test]]
|
|
name = "repetition-plus-leftmost-first-200"
|
|
regex = '(abc)+'
|
|
haystack = "zzabcabczzabc"
|
|
matches = [
|
|
[[2, 5], [2, 5]],
|
|
[[5, 8], [5, 8]],
|
|
[[2, 8], [5, 8]],
|
|
]
|
|
match-kind = "leftmost-first"
|
|
search-kind = "overlapping"
|
|
|
|
[[test]]
|
|
name = "repetition-plus-all-200"
|
|
regex = '(abc)+'
|
|
haystack = "zzabcabczzabc"
|
|
matches = [
|
|
[[2, 5], [2, 5]],
|
|
[[5, 8], [5, 8]],
|
|
[[2, 8], [5, 8]],
|
|
[[10, 13], [10, 13]],
|
|
]
|
|
match-kind = "all"
|
|
search-kind = "overlapping"
|
|
|
|
[[test]]
|
|
name = "repetition-star-leftmost-first-100"
|
|
regex = 'a*'
|
|
haystack = "aaa"
|
|
matches = [
|
|
[0, 0],
|
|
[1, 1],
|
|
[0, 1],
|
|
[2, 2],
|
|
[1, 2],
|
|
[0, 2],
|
|
[3, 3],
|
|
[2, 3],
|
|
[1, 3],
|
|
[0, 3],
|
|
]
|
|
match-kind = "leftmost-first"
|
|
search-kind = "overlapping"
|
|
|
|
[[test]]
|
|
name = "repetition-star-all-100"
|
|
regex = 'a*'
|
|
haystack = "aaa"
|
|
matches = [
|
|
[0, 0],
|
|
[1, 1],
|
|
[0, 1],
|
|
[2, 2],
|
|
[1, 2],
|
|
[0, 2],
|
|
[3, 3],
|
|
[2, 3],
|
|
[1, 3],
|
|
[0, 3],
|
|
]
|
|
match-kind = "all"
|
|
search-kind = "overlapping"
|
|
|
|
[[test]]
|
|
name = "repetition-star-leftmost-first-200"
|
|
regex = '(abc)*'
|
|
haystack = "zzabcabczzabc"
|
|
matches = [
|
|
[[0, 0], []],
|
|
]
|
|
match-kind = "leftmost-first"
|
|
search-kind = "overlapping"
|
|
|
|
[[test]]
|
|
name = "repetition-star-all-200"
|
|
regex = '(abc)*'
|
|
haystack = "zzabcabczzabc"
|
|
matches = [
|
|
[[0, 0], []],
|
|
[[1, 1], []],
|
|
[[2, 2], []],
|
|
[[3, 3], []],
|
|
[[4, 4], []],
|
|
[[5, 5], []],
|
|
[[2, 5], [2, 5]],
|
|
[[6, 6], []],
|
|
[[7, 7], []],
|
|
[[8, 8], []],
|
|
[[5, 8], [5, 8]],
|
|
[[2, 8], [5, 8]],
|
|
[[9, 9], []],
|
|
[[10, 10], []],
|
|
[[11, 11], []],
|
|
[[12, 12], []],
|
|
[[13, 13], []],
|
|
[[10, 13], [10, 13]],
|
|
]
|
|
match-kind = "all"
|
|
search-kind = "overlapping"
|
|
|
|
[[test]]
|
|
name = "start-end-rep-leftmost-first"
|
|
regex = '(^$)*'
|
|
haystack = "abc"
|
|
matches = [
|
|
[[0, 0], []],
|
|
]
|
|
match-kind = "leftmost-first"
|
|
search-kind = "overlapping"
|
|
|
|
[[test]]
|
|
name = "start-end-rep-all"
|
|
regex = '(^$)*'
|
|
haystack = "abc"
|
|
matches = [
|
|
[[0, 0], []],
|
|
[[1, 1], []],
|
|
[[2, 2], []],
|
|
[[3, 3], []],
|
|
]
|
|
match-kind = "all"
|
|
search-kind = "overlapping"
|
|
|
|
[[test]]
|
|
name = "alt-leftmost-first-100"
|
|
regex = 'abc|a'
|
|
haystack = "zzabcazzaabc"
|
|
matches = [[2, 3], [2, 5]]
|
|
match-kind = "leftmost-first"
|
|
search-kind = "overlapping"
|
|
|
|
[[test]]
|
|
name = "alt-all-100"
|
|
regex = 'abc|a'
|
|
haystack = "zzabcazzaabc"
|
|
matches = [[2, 3], [2, 5], [5, 6], [8, 9], [9, 10], [9, 12]]
|
|
match-kind = "all"
|
|
search-kind = "overlapping"
|
|
|
|
[[test]]
|
|
name = "empty-000"
|
|
regex = ""
|
|
haystack = "abc"
|
|
matches = [[0, 0], [1, 1], [2, 2], [3, 3]]
|
|
match-kind = "all"
|
|
search-kind = "overlapping"
|
|
|
|
[[test]]
|
|
name = "empty-alt-000"
|
|
regex = "|b"
|
|
haystack = "abc"
|
|
matches = [[0, 0], [1, 1], [2, 2], [1, 2], [3, 3]]
|
|
match-kind = "all"
|
|
search-kind = "overlapping"
|
|
|
|
[[test]]
|
|
name = "empty-alt-010"
|
|
regex = "b|"
|
|
haystack = "abc"
|
|
matches = [[0, 0], [1, 1], [2, 2], [1, 2], [3, 3]]
|
|
match-kind = "all"
|
|
search-kind = "overlapping"
|
|
|
|
[[test]]
|
|
# See: https://github.com/rust-lang/regex/issues/484
|
|
name = "iter1-bytes"
|
|
regex = ''
|
|
haystack = "☃"
|
|
matches = [[0, 0], [1, 1], [2, 2], [3, 3]]
|
|
utf8 = false
|
|
match-kind = "all"
|
|
search-kind = "overlapping"
|
|
|
|
[[test]]
|
|
# See: https://github.com/rust-lang/regex/issues/484
|
|
name = "iter1-utf8"
|
|
regex = ''
|
|
haystack = "☃"
|
|
matches = [[0, 0], [3, 3]]
|
|
match-kind = "all"
|
|
search-kind = "overlapping"
|
|
|
|
[[test]]
|
|
name = "iter1-incomplete-utf8"
|
|
regex = ''
|
|
haystack = '\xE2\x98' # incomplete snowman
|
|
matches = [[0, 0], [1, 1], [2, 2]]
|
|
match-kind = "all"
|
|
search-kind = "overlapping"
|
|
unescape = true
|
|
utf8 = false
|
|
|
|
[[test]]
|
|
name = "scratch"
|
|
regex = ['sam', 'samwise']
|
|
haystack = "samwise"
|
|
matches = [
|
|
{ id = 0, span = [0, 3] },
|
|
]
|
|
match-kind = "leftmost-first"
|
|
search-kind = "overlapping"
|