Skip to main content

worktree_io/
templates.rs

1/// Scaffold written to `.worktree.toml` when the file is absent.
2pub const WORKTREE_TOML: &str = include_str!("../assets/worktree.toml");
3
4/// Default commented config written to `~/.config/worktree/config.toml`.
5pub const CONFIG_TOML: &str = include_str!("../assets/config.toml");
6
7/// Reference template showing the format of the workspaces registry file.
8pub const WORKSPACES_TOML: &str = include_str!("../assets/workspaces.toml");
9
10#[cfg(test)]
11mod tests {
12    use super::*;
13    use crate::Config;
14
15    #[test]
16    fn config_toml_in_sync_with_default() {
17        assert_eq!(CONFIG_TOML, Config::default().to_toml_with_comments());
18    }
19
20    #[test]
21    fn worktree_toml_starts_with_comment() {
22        assert!(WORKTREE_TOML.starts_with('#'));
23    }
24
25    #[test]
26    fn workspaces_toml_starts_with_comment() {
27        assert!(WORKSPACES_TOML.starts_with('#'));
28    }
29}