From fb77b7288ce5406ff819d8fd71ad59e317d1817f Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen Date: Thu, 9 Jul 2020 12:49:58 -0700 Subject: Add operator<< to print a quaternion. --- test/geo_quaternion.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/geo_quaternion.cpp') diff --git a/test/geo_quaternion.cpp b/test/geo_quaternion.cpp index 1da683c0e..b339a5f39 100644 --- a/test/geo_quaternion.cpp +++ b/test/geo_quaternion.cpp @@ -75,6 +75,11 @@ template void quaternion(void) q1.coeffs().setRandom(); VERIFY_IS_APPROX(q1.coeffs(), (q1*q2).coeffs()); + // Printing + std::ostringstream ss; + ss << q2; + VERIFY(ss.str() == "0i + 0j + 0k + 1"); + // concatenation q1 *= q2; -- cgit v1.2.3