Put some tests behind #[cfg(test)] (#1459)

It was missing in a few places.
pull/1465/head
Benoît Cortier 3 years ago committed by GitHub
parent 939261fc07
commit 05e5520ec0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -20,8 +20,12 @@ pub struct LspConfig {
pub display_messages: bool,
}
#[test]
fn parsing_keymaps_config_file() {
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn parsing_keymaps_config_file() {
use crate::keymap;
use crate::keymap::Keymap;
use helix_core::hashmap;
@ -51,4 +55,5 @@ fn parsing_keymaps_config_file() {
..Default::default()
}
);
}
}

@ -296,8 +296,12 @@ impl TryFrom<Value> for ThemePalette {
}
}
#[test]
fn test_parse_style_string() {
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_parse_style_string() {
let fg = Value::String("#ffffff".to_string());
let mut style = Style::default();
@ -305,10 +309,10 @@ fn test_parse_style_string() {
palette.parse_style(&mut style, fg).unwrap();
assert_eq!(style, Style::default().fg(Color::Rgb(255, 255, 255)));
}
}
#[test]
fn test_palette() {
#[test]
fn test_palette() {
use helix_core::hashmap;
let fg = Value::String("my_color".to_string());
@ -318,10 +322,10 @@ fn test_palette() {
palette.parse_style(&mut style, fg).unwrap();
assert_eq!(style, Style::default().fg(Color::Rgb(255, 255, 255)));
}
}
#[test]
fn test_parse_style_table() {
#[test]
fn test_parse_style_table() {
let table = toml::toml! {
"keyword" = {
fg = "#ffffff",
@ -345,4 +349,5 @@ fn test_parse_style_table() {
.bg(Color::Rgb(0, 0, 0))
.add_modifier(Modifier::BOLD)
);
}
}

Loading…
Cancel
Save