forked from QMCPACK/qmcpack
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
72 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
////////////////////////////////////////////////////////////////////////////////////// | ||
// This file is distributed under the University of Illinois/NCSA Open Source License. | ||
// See LICENSE file in top directory for details. | ||
// | ||
// Copyright (c) 2021 QMCPACK developers. | ||
// | ||
// File developed by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory | ||
// | ||
// File created by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory | ||
////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
#include "catch.hpp" | ||
#include <sstream> | ||
#include "StlPrettyPrint.hpp" | ||
|
||
namespace qmcplusplus | ||
{ | ||
TEST_CASE("StlPrettyPrint", "[utilities]") | ||
{ | ||
std::ostringstream msg; | ||
std::vector<int> vec; | ||
|
||
msg << vec; | ||
CHECK(msg.str() == "[]"); | ||
|
||
msg.str(std::string()); | ||
vec = {4, 4, 3, 3}; | ||
msg << vec; | ||
CHECK(msg.str() == "[4(x2), 3(x2)]"); | ||
|
||
msg.str(std::string()); | ||
vec = {4, 4, 3}; | ||
msg << vec; | ||
CHECK(msg.str() == "[4(x2), 3]"); | ||
|
||
msg.str(std::string()); | ||
vec = {4, 3, 3}; | ||
msg << vec; | ||
CHECK(msg.str() == "[4, 3(x2)]"); | ||
|
||
msg.str(std::string()); | ||
vec = {4, 3, 2}; | ||
msg << vec; | ||
CHECK(msg.str() == "[4, 3, 2]"); | ||
} | ||
} // namespace qmcplusplus |