aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/config.rs')
-rw-r--r--helix-term/src/config.rs51
1 files changed, 28 insertions, 23 deletions
diff --git a/helix-term/src/config.rs b/helix-term/src/config.rs
index 3745f871..6b8bbc1b 100644
--- a/helix-term/src/config.rs
+++ b/helix-term/src/config.rs
@@ -20,14 +20,18 @@ pub struct LspConfig {
pub display_messages: bool,
}
-#[test]
-fn parsing_keymaps_config_file() {
- use crate::keymap;
- use crate::keymap::Keymap;
- use helix_core::hashmap;
- use helix_view::document::Mode;
-
- let sample_keymaps = r#"
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn parsing_keymaps_config_file() {
+ use crate::keymap;
+ use crate::keymap::Keymap;
+ use helix_core::hashmap;
+ use helix_view::document::Mode;
+
+ let sample_keymaps = r#"
[keys.insert]
y = "move_line_down"
S-C-a = "delete_selection"
@@ -36,19 +40,20 @@ fn parsing_keymaps_config_file() {
A-F12 = "move_next_word_end"
"#;
- assert_eq!(
- toml::from_str::<Config>(sample_keymaps).unwrap(),
- Config {
- keys: Keymaps(hashmap! {
- Mode::Insert => Keymap::new(keymap!({ "Insert mode"
- "y" => move_line_down,
- "S-C-a" => delete_selection,
- })),
- Mode::Normal => Keymap::new(keymap!({ "Normal mode"
- "A-F12" => move_next_word_end,
- })),
- }),
- ..Default::default()
- }
- );
+ assert_eq!(
+ toml::from_str::<Config>(sample_keymaps).unwrap(),
+ Config {
+ keys: Keymaps(hashmap! {
+ Mode::Insert => Keymap::new(keymap!({ "Insert mode"
+ "y" => move_line_down,
+ "S-C-a" => delete_selection,
+ })),
+ Mode::Normal => Keymap::new(keymap!({ "Normal mode"
+ "A-F12" => move_next_word_end,
+ })),
+ }),
+ ..Default::default()
+ }
+ );
+ }
}