Add tests for odd headline levels.
This commit is contained in:
@@ -29,6 +29,8 @@ pub struct GlobalSettings<'g, 's> {
|
||||
pub odd_levels_only: HeadlineLevelFilter,
|
||||
}
|
||||
|
||||
pub const DEFAULT_TAB_WIDTH: IndentationLevel = 8;
|
||||
|
||||
impl<'g, 's> GlobalSettings<'g, 's> {
|
||||
fn new() -> GlobalSettings<'g, 's> {
|
||||
GlobalSettings {
|
||||
@@ -39,8 +41,8 @@ impl<'g, 's> GlobalSettings<'g, 's> {
|
||||
in_progress_todo_keywords: BTreeSet::new(),
|
||||
complete_todo_keywords: BTreeSet::new(),
|
||||
list_allow_alphabetical: false,
|
||||
tab_width: 8,
|
||||
odd_levels_only: HeadlineLevelFilter::OddEven,
|
||||
tab_width: DEFAULT_TAB_WIDTH,
|
||||
odd_levels_only: HeadlineLevelFilter::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,8 +53,14 @@ impl<'g, 's> Default for GlobalSettings<'g, 's> {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum HeadlineLevelFilter {
|
||||
Odd,
|
||||
OddEven,
|
||||
}
|
||||
|
||||
impl Default for HeadlineLevelFilter {
|
||||
fn default() -> Self {
|
||||
HeadlineLevelFilter::OddEven
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,5 +26,6 @@ pub use file_access_interface::FileAccessInterface;
|
||||
pub use file_access_interface::LocalFileAccessInterface;
|
||||
pub use global_settings::GlobalSettings;
|
||||
pub use global_settings::HeadlineLevelFilter;
|
||||
pub use global_settings::DEFAULT_TAB_WIDTH;
|
||||
pub(crate) use list::List;
|
||||
pub(crate) use parser_with_context::parser_with_context;
|
||||
|
||||
Reference in New Issue
Block a user