api: test that foreground highlights are set correctly

This commit is contained in:
Riccardo Mazzarini 2024-10-07 18:13:04 +08:00
parent 96d95c1641
commit a614fa52fe
No known key found for this signature in database
GPG key ID: 38165222613796F5

View file

@ -109,6 +109,19 @@ fn get_runtime_file() {
assert!(api::get_runtime_file("*", true).unwrap().next().is_some());
}
#[oxi::test]
fn hl_foreground() {
let opts = SetHighlightOpts::builder()
.foreground("#FF0000")
.strikethrough(true)
.bold(true)
.build();
api::set_hl(0, "Header", &opts).unwrap();
let infos = api::get_hl_by_name("Header", true).unwrap();
assert_eq!(infos.foreground, Some(16711680));
}
#[oxi::test]
fn hl_underline() {
let opts = SetHighlightOpts::builder().underline(true).build();