aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/config.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2022-02-13 09:31:51 +0000
committerBlaž Hrastnik2022-02-13 09:31:51 +0000
commitbd549d8a20cce98e24c8653a4a86107c786cbaa3 (patch)
tree0780b58d41b6181e69023265cdb54517e2953778 /helix-term/src/config.rs
parent7ad8eaaef0b292f4be6c66298cea40d2b928e172 (diff)
parent7083b98a388b30e0b61caac9bf6ccc1d79eadf81 (diff)
Merge remote-tracking branch 'origin/master' into debug
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()
+ }
+ );
+ }
}