util_test.hpp
Go to the documentation of this file.
1 #include <gtest/gtest.h>
2 #include <test/unit/util.hpp>
3 
4 TEST(TestUnitUtil, streams) {
5 
6  std::cout << "foo";
7  std::cerr << "bar";
9  EXPECT_EQ("foo", stan::test::cout_ss.str());
10  EXPECT_EQ("bar", stan::test::cerr_ss.str());
11 
13  EXPECT_EQ("", stan::test::cout_ss.str());
14  EXPECT_EQ("", stan::test::cerr_ss.str());
15 }
TEST(TestUnitUtil, streams)
Definition: util_test.hpp:4
OStream cerr
Definition: OStream.cxx:7
void reset_std_streams()
Definition: util.hpp:47
OStream cout
Definition: OStream.cxx:6
void capture_std_streams()
Definition: util.hpp:36
std::stringstream cerr_ss
Definition: util.hpp:34
std::stringstream cout_ss
Definition: util.hpp:33