Compare start/end time.
This commit is contained in:
@@ -43,6 +43,7 @@ use crate::types::GetStandardProperties;
|
||||
use crate::types::GreaterBlock;
|
||||
use crate::types::Heading;
|
||||
use crate::types::HorizontalRule;
|
||||
use crate::types::Hour;
|
||||
use crate::types::HourInner;
|
||||
use crate::types::InlineBabelCall;
|
||||
use crate::types::InlineSourceBlock;
|
||||
@@ -51,6 +52,7 @@ use crate::types::Keyword;
|
||||
use crate::types::LatexEnvironment;
|
||||
use crate::types::LatexFragment;
|
||||
use crate::types::LineBreak;
|
||||
use crate::types::Minute;
|
||||
use crate::types::MinuteInner;
|
||||
use crate::types::Month;
|
||||
use crate::types::MonthInner;
|
||||
@@ -81,6 +83,7 @@ use crate::types::Table;
|
||||
use crate::types::TableCell;
|
||||
use crate::types::TableRow;
|
||||
use crate::types::Target;
|
||||
use crate::types::Time;
|
||||
use crate::types::Timestamp;
|
||||
use crate::types::TimestampRangeType;
|
||||
use crate::types::TimestampType;
|
||||
@@ -2247,6 +2250,58 @@ fn compare_timestamp<'b, 's>(
|
||||
// Compare time start
|
||||
let hour_start: Option<HourInner> = get_property_numeric(emacs, ":hour-start")?;
|
||||
let minute_start: Option<MinuteInner> = get_property_numeric(emacs, ":minute-start")?;
|
||||
let rust_hour_start = rust
|
||||
.start_time
|
||||
.as_ref()
|
||||
.map(Time::get_hour)
|
||||
.map(Hour::get_value);
|
||||
let rust_minute_start = rust
|
||||
.start_time
|
||||
.as_ref()
|
||||
.map(Time::get_minute)
|
||||
.map(Minute::get_value);
|
||||
if hour_start != rust_hour_start {
|
||||
this_status = DiffStatus::Bad;
|
||||
message = Some(format!(
|
||||
"hour start mismatch (emacs != rust) {:?} != {:?}",
|
||||
hour_start, rust_hour_start
|
||||
));
|
||||
}
|
||||
if minute_start != rust_minute_start {
|
||||
this_status = DiffStatus::Bad;
|
||||
message = Some(format!(
|
||||
"minute start mismatch (emacs != rust) {:?} != {:?}",
|
||||
minute_start, rust_minute_start
|
||||
));
|
||||
}
|
||||
|
||||
// Compare time end
|
||||
let hour_end: Option<HourInner> = get_property_numeric(emacs, ":hour-end")?;
|
||||
let minute_end: Option<MinuteInner> = get_property_numeric(emacs, ":minute-end")?;
|
||||
let rust_hour_end = rust
|
||||
.end_time
|
||||
.as_ref()
|
||||
.map(Time::get_hour)
|
||||
.map(Hour::get_value);
|
||||
let rust_minute_end = rust
|
||||
.end_time
|
||||
.as_ref()
|
||||
.map(Time::get_minute)
|
||||
.map(Minute::get_value);
|
||||
if hour_end != rust_hour_end {
|
||||
this_status = DiffStatus::Bad;
|
||||
message = Some(format!(
|
||||
"hour end mismatch (emacs != rust) {:?} != {:?}",
|
||||
hour_end, rust_hour_end
|
||||
));
|
||||
}
|
||||
if minute_end != rust_minute_end {
|
||||
this_status = DiffStatus::Bad;
|
||||
message = Some(format!(
|
||||
"minute end mismatch (emacs != rust) {:?} != {:?}",
|
||||
minute_end, rust_minute_end
|
||||
));
|
||||
}
|
||||
|
||||
// TODO: Compare :hour-start :minute-start :hour-end :minute-end :repeater-type :repeater-value :repeater-unit :warning-type :warning-value :warning-unit
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user