Skip to content
7 changes: 7 additions & 0 deletions src/feature_flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ define_feature_flags!(
async_mode: async_mode, debug = false, release = false,
git_hooks_enabled: git_hooks_enabled, debug = false, release = false,
git_hooks_externally_managed: git_hooks_externally_managed, debug = false, release = false,
sharded_notes: sharded_notes, debug = false, release = false, // gated behind config
);

impl FeatureFlags {
Expand Down Expand Up @@ -127,6 +128,7 @@ mod tests {
assert!(!flags.async_mode);
assert!(!flags.git_hooks_enabled);
assert!(!flags.git_hooks_externally_managed);
assert!(!flags.sharded_notes);
}
#[cfg(not(debug_assertions))]
{
Expand All @@ -136,6 +138,7 @@ mod tests {
assert!(!flags.async_mode);
assert!(!flags.git_hooks_enabled);
assert!(!flags.git_hooks_externally_managed);
assert!(!flags.sharded_notes);
}
}

Expand Down Expand Up @@ -245,6 +248,7 @@ mod tests {
async_mode: true,
git_hooks_enabled: false,
git_hooks_externally_managed: false,
sharded_notes: false,
};

let serialized = serde_json::to_string(&flags).unwrap();
Expand All @@ -254,6 +258,7 @@ mod tests {
assert!(serialized.contains("async_mode"));
assert!(serialized.contains("git_hooks_enabled"));
assert!(serialized.contains("git_hooks_externally_managed"));
assert!(serialized.contains("sharded_notes"));
}

#[test]
Expand All @@ -265,6 +270,7 @@ mod tests {
async_mode: true,
git_hooks_enabled: true,
git_hooks_externally_managed: false,
sharded_notes: true,
};
let cloned = flags.clone();
assert_eq!(cloned.rewrite_stash, flags.rewrite_stash);
Expand All @@ -276,6 +282,7 @@ mod tests {
cloned.git_hooks_externally_managed,
flags.git_hooks_externally_managed
);
assert_eq!(cloned.sharded_notes, flags.sharded_notes);
}

#[test]
Expand Down
Loading
Loading