Compare range type.

This commit is contained in:
Tom Alexander
2023-10-02 13:42:46 -04:00
parent d04c8c832c
commit 3ed9b552e2
4 changed files with 30 additions and 0 deletions

View File

@@ -74,6 +74,7 @@ use crate::types::TableCell;
use crate::types::TableRow;
use crate::types::Target;
use crate::types::Timestamp;
use crate::types::TimestampRangeType;
use crate::types::TimestampType;
use crate::types::TodoKeywordType;
use crate::types::Underline;
@@ -2137,6 +2138,19 @@ fn compare_timestamp<'b, 's>(
}
}
let range_type = get_property_unquoted_atom(emacs, ":range-type")?;
match (range_type, &rust.range_type) {
(Some("daterange"), TimestampRangeType::DateRange) => {}
(None, TimestampRangeType::None) => {}
_ => {
this_status = DiffStatus::Bad;
message = Some(format!(
"Range type mismatch (emacs != rust) {:?} != {:?}",
range_type, rust.range_type
));
}
}
// TODO: Compare :type :range-type :raw-value :year-start :month-start :day-start :hour-start :minute-start :year-end :month-end :day-end :hour-end :minute-end :repeater-type :repeater-value :repeater-unit :warning-type :warning-value :warning-unit
//
// :type unquoted atom either diary, active, inactive, active-range, or inactive-range.