From a614fa52fea3073839c79e1e76921f32e4a31581 Mon Sep 17 00:00:00 2001 From: Riccardo Mazzarini Date: Mon, 7 Oct 2024 18:13:04 +0800 Subject: [PATCH] api: test that foreground highlights are set correctly --- tests/src/api/global.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/src/api/global.rs b/tests/src/api/global.rs index c2f2f28e..5e6ea104 100644 --- a/tests/src/api/global.rs +++ b/tests/src/api/global.rs @@ -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();