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