From f9c1a2fd9896852b065c017303569076636ad7c7 Mon Sep 17 00:00:00 2001 From: Dimitri Sabadie Date: Fri, 29 Jul 2016 18:02:37 +0200 Subject: [PATCH] Added a test for Quaternion::exp(). --- tests/quat.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/quat.rs b/tests/quat.rs index 251fabfc..cfe2557a 100644 --- a/tests/quat.rs +++ b/tests/quat.rs @@ -1,7 +1,7 @@ extern crate nalgebra as na; extern crate rand; -use na::{Point3, Vector3, Rotation3, UnitQuaternion, Rotation}; +use na::{Point3, Quaternion, Vector3, Rotation3, UnitQuaternion, Rotation, one}; use rand::random; #[test] @@ -90,3 +90,9 @@ fn test_quaternion_angle_between() { assert!(na::approx_eq(&na::norm(&na::rotation(&delta)), &delta_angle)) } + +#[test] +fn test_quaternion_exp_zero_is_one() { + let q = Quaternion::new(0., 0., 0., 0.); + assert!(na::approx_eq(&q.exp(), &one())) +}