diff --git a/src/compare/diff.rs b/src/compare/diff.rs index 98a7bdcd..79288b76 100644 --- a/src/compare/diff.rs +++ b/src/compare/diff.rs @@ -43,6 +43,7 @@ use crate::types::GetStandardProperties; use crate::types::GreaterBlock; use crate::types::Heading; use crate::types::HorizontalRule; +use crate::types::HourInner; use crate::types::InlineBabelCall; use crate::types::InlineSourceBlock; use crate::types::Italic; @@ -50,6 +51,7 @@ use crate::types::Keyword; use crate::types::LatexEnvironment; use crate::types::LatexFragment; use crate::types::LineBreak; +use crate::types::MinuteInner; use crate::types::Month; use crate::types::MonthInner; use crate::types::NodeProperty; @@ -2163,11 +2165,12 @@ fn compare_timestamp<'b, 's>( // 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 { + if raw_value != rust.get_raw_value() { this_status = DiffStatus::Bad; message = Some(format!( "Raw value mismatch (emacs != rust) {:?} != {:?}", - raw_value, rust.source + raw_value, + rust.get_raw_value() )); } @@ -2241,6 +2244,10 @@ fn compare_timestamp<'b, 's>( )); } + // Compare time start + let hour_start: Option = get_property_numeric(emacs, ":hour-start")?; + let minute_start: Option = get_property_numeric(emacs, ":minute-start")?; + // TODO: Compare :hour-start :minute-start :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. diff --git a/src/types/object.rs b/src/types/object.rs index 885745a7..229e2a91 100644 --- a/src/types/object.rs +++ b/src/types/object.rs @@ -586,3 +586,9 @@ impl<'s> StandardProperties<'s> for PlainText<'s> { self.source } } + +impl<'s> Timestamp<'s> { + pub fn get_raw_value(&self) -> &'s str { + self.source.trim_end() + } +}