|
|
|
@ -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)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|