fix: termwiz underline color test (#1094)

Fixes code that doesn't compile in the termwiz tests when
underline-color feature is enabled.
This commit is contained in:
Josh McKinney 2024-05-10 20:04:58 -07:00 committed by GitHub
parent aa4260f92c
commit b30411d1c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -575,6 +575,7 @@ mod tests {
}
#[test]
#[cfg(not(feature = "underline-color"))]
fn from_cell_attribute_for_style() {
// default
assert_eq!(
@ -599,20 +600,6 @@ mod tests {
),
Style::new().fg(Color::Reset).bg(Color::Indexed(31))
);
// underline color
#[cfg(feature = "underline-color")]
assert_eq!(
Style::from(
CellAttributes::default()
.set_underline_color(AnsiColor::Red)
.set
.to_owned()
),
Style::new()
.fg(Color::Reset)
.bg(Color::Reset)
.underline_color(Color::Red)
);
// underlined
assert_eq!(
Style::from(
@ -657,4 +644,21 @@ mod tests {
Style::new().fg(Color::Reset).bg(Color::Reset).hidden()
);
}
#[test]
#[cfg(feature = "underline-color")]
fn from_cell_attributes_with_underline_color() {
// underline color
assert_eq!(
Style::from(
CellAttributes::default()
.set_underline_color(AnsiColor::Red)
.to_owned()
),
Style::new()
.fg(Color::Reset)
.bg(Color::Reset)
.underline_color(Color::Indexed(9))
);
}
}