From ecdfd7087f2fb3db6b46862070eaaa7b8b3b7484 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Mon, 2 Oct 2023 14:45:20 -0400 Subject: [PATCH] Compare raw-value. --- src/compare/diff.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/compare/diff.rs b/src/compare/diff.rs index b3b27a4..a34c6f7 100644 --- a/src/compare/diff.rs +++ b/src/compare/diff.rs @@ -2138,6 +2138,7 @@ fn compare_timestamp<'b, 's>( } } + // Compare range-type let range_type = get_property_unquoted_atom(emacs, ":range-type")?; match (range_type, &rust.range_type) { (Some("daterange"), TimestampRangeType::DateRange) => {} @@ -2151,7 +2152,18 @@ fn compare_timestamp<'b, 's>( } } - // 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 + // Compare raw-value + let raw_value = get_property_quoted_string(emacs, ":raw-value")? + .ok_or("Timestamps should have a :raw-value.")?; + if raw_value != rust.source { + this_status = DiffStatus::Bad; + message = Some(format!( + "Raw value mismatch (emacs != rust) {:?} != {:?}", + raw_value, rust.source + )); + } + + // TODO: Compare :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. // :range-type unquoted atom either nil, daterange