This commit is contained in:
2025-01-31 08:29:17 +03:00
parent f8d675dcaf
commit 5670efc4cb
20 changed files with 1038 additions and 184 deletions

27
examples/data/radixtree.vsh Executable file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/env -S v -n -w -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run
import freeflowuniverse.herolib.data.radixtree
mut rt := radixtree.new(path:'/tmp/radixtree_test',reset:true)!
// Show initial state
println('\nInitial state:')
rt.debug_db()!
// Test insert
println('\nInserting key "test" with value "value1"')
rt.insert('test', 'value1'.bytes())!
// Show state after insert
println('\nState after insert:')
rt.debug_db()!
// Print tree structure
rt.print_tree()!
// Test search
if value := rt.search('test') {
println('\nFound value: ${value.bytestr()}')
} else {
println('\nError: ${err}')
}