QMCPACK
test_StlPrettyPrint.cpp
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2021 QMCPACK developers.
6 //
7 // File developed by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
8 //
9 // File created by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 #include "catch.hpp"
13 #include <sstream>
14 #include "StlPrettyPrint.hpp"
15 
16 namespace qmcplusplus
17 {
18 TEST_CASE("StlPrettyPrint", "[utilities]")
19 {
20  std::ostringstream msg;
21  std::vector<int> vec;
22 
23  msg << vec;
24  CHECK(msg.str() == "[]");
25 
26  msg.str(std::string());
27  vec = {4, 4, 3, 3};
28  msg << vec;
29  CHECK(msg.str() == "[4(x2), 3(x2)]");
30 
31  msg.str(std::string());
32  vec = {4, 4, 3};
33  msg << vec;
34  CHECK(msg.str() == "[4(x2), 3]");
35 
36  msg.str(std::string());
37  vec = {4, 3, 3};
38  msg << vec;
39  CHECK(msg.str() == "[4, 3(x2)]");
40 
41  msg.str(std::string());
42  vec = {4, 3, 2};
43  msg << vec;
44  CHECK(msg.str() == "[4, 3, 2]");
45 }
46 } // namespace qmcplusplus
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
TEST_CASE("complex_helper", "[type_traits]")
CHECK(log_values[0]==ComplexApprox(std::complex< double >{ 5.603777579195571, -6.1586603331188225 }))