mod harvest;
#[cfg(test)]
mod harvest_tests;
mod live;
mod matcher;
mod registry;
#[cfg(test)]
mod registry_tests;
#[cfg(test)]
pub(crate) use harvest::caption;
pub(crate) use harvest::harvest_tab;
pub use harvest::{SearchTag, tag};
#[cfg(test)]
pub(crate) use live::flashing;
pub(crate) use live::{
DrawnSection, Jump, LiveView, forces_open, live_view, note_section, set_live_view, start_jump,
};
pub use matcher::{Haystack, Query};
pub use registry::{ControlEntry, Hit, Registry, SectionEntry, tab_name_matches};
#[cfg(test)]
pub(crate) fn test_registry() -> std::sync::Arc<Registry> {
thread_local! {
static REGISTRY: std::sync::Arc<Registry> = crate::settings_ui::SettingsUI::new_for_tests(
par_term_config::Config::default(),
)
.search_registry();
}
REGISTRY.with(std::sync::Arc::clone)
}
#[cfg(test)]
pub(crate) fn tab_has_result(tab: crate::sidebar::SettingsTab, query: &str) -> bool {
let registry = test_registry();
let query = Query::parse(query);
let hits = registry.search(&query);
registry.tab_matches(tab, &query, &hits)
}
#[cfg(test)]
mod ui_tests;