Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Added some tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao committed Aug 31, 2021
1 parent f017e08 commit 4d7d3ee
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion tests/it/array/primitive/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
use arrow2::{array::*, bitmap::Bitmap, datatypes::*, types::days_ms};
use std::iter::FromIterator;

use arrow2::{
array::*,
bitmap::Bitmap,
datatypes::*,
types::{days_ms, months_days_ns},
};

mod mutable;

#[test]
Expand Down Expand Up @@ -220,3 +226,33 @@ fn display_interval_days_ms() {
let array = DaysMsArray::from(&[Some(days_ms::new(1, 1)), None, Some(days_ms::new(2, 2))]);
assert_eq!(format!("{}", array), "Interval(DayTime)[1d1ms, , 2d2ms]");
}

#[test]
fn display_months_days_ns() {
let data = &[
Some(months_days_ns::new(1, 1, 2)),
None,
Some(months_days_ns::new(2, 3, 3)),
];

let array = MonthsDaysNsArray::from(&data);

assert_eq!(
format!("{}", array),
"Interval(MonthDayNano)[1m1d2ns, , 2m3d3ns]"
);
}

#[test]
fn months_days_ns() {
let data = &[
months_days_ns::new(1, 1, 2),
months_days_ns::new(1, 1, 3),
months_days_ns::new(2, 3, 3),
];

let array = MonthsDaysNsArray::from_slice(&data);

let a = array.values().as_slice();
assert_eq!(a, data.as_ref());
}

0 comments on commit 4d7d3ee

Please sign in to comment.