Skip to content

Commit

Permalink
make sure the 2 test cases being compared are actually called in the …
Browse files Browse the repository at this point in the history
…same manner
  • Loading branch information
dam5h committed Feb 9, 2021
1 parent cb3d354 commit 8751d21
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/sort-axis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,10 @@ mod tests {
assert_eq!(sorted_f[0], 74880.05859375);
assert_eq!(sorted_f[283103], 109439.94140625);

let perm =
a.sort_axis_(Axis(0), |i, j| a[[i, 0]].partial_cmp(&a[[j, 0]]).unwrap());
let perm = a.sort_axis_by(Axis(0), |i, j| a[[i, 0]] < a[[j, 0]]);
assert_eq!(perm.indices[0], 5897);
assert_eq!(perm.indices[283103], 176939);

let b = a.permute_axis(Axis(0), &perm);
assert_eq!(b[[0, 0]], 74880.05859375);
assert_eq!(b[[283103, 0]], 109439.941);
Expand Down

0 comments on commit 8751d21

Please sign in to comment.