Add unit test for printing empty tensors

This commit is contained in:
Gael Guennebaud 2016-06-23 18:54:30 +02:00
parent 360a743a10
commit 361dbd246d

View File

@ -40,6 +40,12 @@ static void test_output_1d()
std::string expected("0\n1\n2\n3\n4");
VERIFY_IS_EQUAL(std::string(os.str()), expected);
Eigen::Tensor<double,1,DataLayout> empty_tensor(0);
std::stringstream empty_os;
empty_os << empty_tensor;
std::string empty_string;
VERIFY_IS_EQUAL(std::string(empty_os.str()), empty_string);
}