diff --git a/tests/unit/test_xtensor.cpp b/tests/unit/test_xtensor.cpp index caead4a0a..ac0b4d743 100644 --- a/tests/unit/test_xtensor.cpp +++ b/tests/unit/test_xtensor.cpp @@ -73,7 +73,7 @@ TEST_CASE("xt::xarray reshape", "[xtensor]") { } TEST_CASE("xt::xview example", "[xtensor]") { - File file("rw_dataset_xarray.h5", File::Truncate); + File file("rw_dataset_xview.h5", File::Truncate); std::vector shape{13, 5, 7}; xt::xarray a = testing::DataGenerator>::create(shape); @@ -127,4 +127,16 @@ void check_xtensor_empty(File& file, const XTensor& a, const std::vector REQUIRE(c_shape == expected_dims); } +TEST_CASE("xt::xtensor empty", "[xtensor]") { + File file("rw_dataset_xtensor_empty.h5", File::Truncate); + xt::xtensor a({0, 1, 1}); + check_xtensor_empty(file, a, {0, 1, 1, 1}); +} + +TEST_CASE("xt::xarray empty", "[xtensor]") { + File file("rw_dataset_xarray_empty.h5", File::Truncate); + xt::xarray a(std::vector{1, 0, 1}); + check_xtensor_empty(file, a, {0}); +} + #endif