From de32f8d656c3ea7855ced77457ea661e43d417b7 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Mon, 20 Jun 2016 10:46:45 -0700 Subject: Fixed the printing of rank-0 tensors --- unsupported/test/cxx11_tensor_io.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'unsupported/test/cxx11_tensor_io.cpp') diff --git a/unsupported/test/cxx11_tensor_io.cpp b/unsupported/test/cxx11_tensor_io.cpp index 8bbcf7089..8267dcadd 100644 --- a/unsupported/test/cxx11_tensor_io.cpp +++ b/unsupported/test/cxx11_tensor_io.cpp @@ -13,6 +13,20 @@ #include +template +static void test_output_0d() +{ + Tensor tensor; + tensor() = 123; + + std::stringstream os; + os << tensor; + + std::string expected("123"); + VERIFY_IS_EQUAL(std::string(os.str()), expected); +} + + template static void test_output_1d() { @@ -101,6 +115,8 @@ static void test_output_const() void test_cxx11_tensor_io() { + CALL_SUBTEST(test_output_0d()); + CALL_SUBTEST(test_output_0d()); CALL_SUBTEST(test_output_1d()); CALL_SUBTEST(test_output_1d()); CALL_SUBTEST(test_output_2d()); -- cgit v1.2.3