forked from xtensor-stack/xtensor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_xinfo.cpp
35 lines (29 loc) · 1.12 KB
/
test_xinfo.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/***************************************************************************
* Copyright (c) Johan Mabille, Sylvain Corlay and Wolf Vollprecht *
* Copyright (c) QuantStack *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* *
* The full license is in the file LICENSE, distributed with this software. *
****************************************************************************/
#include "test_common_macros.hpp"
#include <sstream>
#include <string>
#include "xtensor/xarray.hpp"
#include "xtensor/xinfo.hpp"
namespace xt
{
TEST(xinfo, compiles)
{
xarray<double> test = {{1,2,3}, {4,5,6}};
std::stringstream ss;
ss << info(test) << std::endl;
}
TEST(xinfo, typename)
{
xarray<double> test = {{1,2,3}, {4,5,6}};
auto t_s = type_to_string<typename decltype(test)::value_type>();
std::string expected = "double";
EXPECT_EQ(expected, t_s);
}
}