Skip to content

Commit 33444aa

Browse files
committed
Add more test
1 parent e98fb25 commit 33444aa

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

examples/histogram.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
1616
.configure_mesh()
1717
.disable_x_mesh()
1818
.line_style_1(&WHITE.mix(0.3))
19-
//.x_label_offset(30)
2019
.y_desc("Count")
2120
.x_desc("Bucket")
2221
.axis_desc_style(("sans-serif", 15).into_font())

src/coord/datetime.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,6 +1002,10 @@ mod test {
10021002

10031003
for i in 1..=12 {
10041004
assert_eq!(coord1.from_index(i - 1).unwrap().month(), i as u32);
1005+
assert_eq!(
1006+
coord1.index_of(&coord1.from_index(i - 1).unwrap()).unwrap(),
1007+
i - 1
1008+
);
10051009
}
10061010
}
10071011

@@ -1012,6 +1016,7 @@ mod test {
10121016

10131017
for i in 0..20 {
10141018
assert_eq!(coord1.from_index(i).unwrap().year(), 2000 + i as i32);
1019+
assert_eq!(coord1.index_of(&coord1.from_index(i).unwrap()).unwrap(), i);
10151020
}
10161021
}
10171022
}

0 commit comments

Comments
 (0)