FIX: small diverse fixes (#35)

This commit is contained in:
Nicolás Hatcher Andrés
2024-04-14 21:50:14 +02:00
committed by GitHub
parent b3b7dea930
commit 49ef846ebd
25 changed files with 246 additions and 2749 deletions

View File

@@ -144,13 +144,18 @@ fn basic_fill() {
let style = model.get_cell_style(0, 1, 1).unwrap();
assert_eq!(style.fill.bg_color, None);
assert_eq!(style.fill.fg_color, None);
// bg_color
model
.update_range_style(&range, "fill.bg_color", "#F2F2F2")
.unwrap();
model
.update_range_style(&range, "fill.fg_color", "#F3F4F5")
.unwrap();
let style = model.get_cell_style(0, 1, 1).unwrap();
assert_eq!(style.fill.bg_color, Some("#F2F2F2".to_owned()));
assert_eq!(style.fill.fg_color, Some("#F3F4F5".to_owned()));
let send_queue = model.flush_send_queue();
@@ -159,6 +164,7 @@ fn basic_fill() {
let style = model2.get_cell_style(0, 1, 1).unwrap();
assert_eq!(style.fill.bg_color, Some("#F2F2F2".to_owned()));
assert_eq!(style.fill.fg_color, Some("#F3F4F5".to_owned()));
}
#[test]
@@ -171,9 +177,15 @@ fn fill_errors() {
width: 1,
height: 1,
};
assert!(model
.update_range_style(&range, "fill.bg_color", "#FFF")
.is_err());
assert_eq!(
model.update_range_style(&range, "fill.bg_color", "#FFF"),
Err("Invalid color: '#FFF'.".to_string())
);
assert_eq!(
model.update_range_style(&range, "fill.fg_color", "#FFF"),
Err("Invalid color: '#FFF'.".to_string())
);
}
#[test]