Skip to content

Commit 0922b2b

Browse files
committed
Change tests to use s![] macro
1 parent 0265666 commit 0922b2b

File tree

2 files changed

+11
-43
lines changed

2 files changed

+11
-43
lines changed

src/dimension/mod.rs

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -881,49 +881,17 @@ mod test {
881881

882882
#[test]
883883
fn slices_intersect_true() {
884-
assert!(slices_intersect(
885-
&Dim([4, 5]),
886-
&[(..).into(), (..).into()],
887-
&[(..).into(), (..).into()],
888-
));
889-
assert!(slices_intersect(
890-
&Dim([4, 5]),
891-
&[0.into(), (..).into()],
892-
&[0.into(), (..).into()],
893-
));
894-
assert!(slices_intersect(
895-
&Dim([4, 5]),
896-
&[SliceOrIndex::from(..).step_by(2), (..).into()],
897-
&[SliceOrIndex::from(..).step_by(3), (..).into()],
898-
));
899-
assert!(slices_intersect(
900-
&Dim([4, 5]),
901-
&[(..).into(), SliceOrIndex::from(..).step_by(2)],
902-
&[(..).into(), SliceOrIndex::from(1..).step_by(3)],
903-
));
904-
assert!(slices_intersect(
905-
&Dim([4, 10]),
906-
&[(..).into(), SliceOrIndex::from(..).step_by(9)],
907-
&[(..).into(), SliceOrIndex::from(3..).step_by(6)],
908-
));
884+
assert!(slices_intersect(&Dim([4, 5]), s![.., ..], s![.., ..]));
885+
assert!(slices_intersect(&Dim([4, 5]), s![0, ..], s![0, ..]));
886+
assert!(slices_intersect(&Dim([4, 5]), s![..;2, ..], s![..;3, ..]));
887+
assert!(slices_intersect(&Dim([4, 5]), s![.., ..;2], s![.., 1..;3]));
888+
assert!(slices_intersect(&Dim([4, 10]), s![.., ..;9], s![.., 3..;6]));
909889
}
910890

911891
#[test]
912892
fn slices_intersect_false() {
913-
assert!(!slices_intersect(
914-
&Dim([4, 5]),
915-
&[SliceOrIndex::from(..).step_by(2), (..).into()],
916-
&[SliceOrIndex::from(1..).step_by(2), (..).into()],
917-
));
918-
assert!(!slices_intersect(
919-
&Dim([4, 5]),
920-
&[SliceOrIndex::from(..).step_by(2), (..).into()],
921-
&[SliceOrIndex::from(1..).step_by(3), (..).into()],
922-
));
923-
assert!(!slices_intersect(
924-
&Dim([4, 5]),
925-
&[(..).into(), SliceOrIndex::from(..).step_by(9)],
926-
&[(..).into(), SliceOrIndex::from(3..).step_by(6)],
927-
));
893+
assert!(!slices_intersect(&Dim([4, 5]), s![..;2, ..], s![1..;2, ..]));
894+
assert!(!slices_intersect(&Dim([4, 5]), s![..;2, ..], s![1..;3, ..]));
895+
assert!(!slices_intersect(&Dim([4, 5]), s![.., ..;9], s![.., 3..;6]));
928896
}
929897
}

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,11 @@ pub use data_traits::{
157157
DataClone,
158158
};
159159

160-
mod dimension;
161-
162160
mod free_functions;
163161
pub use free_functions::*;
164162
pub use iterators::iter;
165163

166-
mod slice;
164+
#[macro_use] mod slice;
167165
mod layout;
168166
mod indexes;
169167
mod iterators;
@@ -176,6 +174,8 @@ mod stacking;
176174
#[macro_use]
177175
mod zip;
178176

177+
mod dimension;
178+
179179
pub use zip::{
180180
Zip,
181181
NdProducer,

0 commit comments

Comments
 (0)