From 429bcbf9c3a479edb96814f9742666421a1148a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Sat, 29 Jun 2013 15:19:21 +0000 Subject: [PATCH] Fix Column implementation generating an ICE. --- src/mat_impl.rs | 2 +- src/tests/mat.rs | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/mat_impl.rs b/src/mat_impl.rs index ff597e79..37bc221c 100644 --- a/src/mat_impl.rs +++ b/src/mat_impl.rs @@ -84,7 +84,7 @@ macro_rules! column_impl( if i == Dim::dim::<$t>() { break } - self.at((i, col)) = copy *e; + self.set((i, col), copy *e); } } diff --git a/src/tests/mat.rs b/src/tests/mat.rs index aa34c711..37f62e8e 100644 --- a/src/tests/mat.rs +++ b/src/tests/mat.rs @@ -9,6 +9,10 @@ use traits::inv::Inv; #[test] use traits::rotation::{Rotation, Rotatable}; #[test] +use traits::indexable::Indexable; +#[test] +use traits::transpose::Transpose; +#[test] use vec::Vec1; #[test] use mat::{Mat1, Mat2, Mat3}; @@ -54,3 +58,11 @@ fn test_rotation2() assert!(randmat.rotated(ang).rotation().approx_eq(ang)); } } + +#[test] +fn test_index_mat2() +{ + let mat: Mat2 = random(); + + assert!(mat.at((0, 1)) == mat.transposed().at((1, 0))); +}