Functions
util_test.hpp File Reference
#include <gtest/gtest.h>
#include <test/unit/util.hpp>

Go to the source code of this file.

Functions

 TEST (TestUnitUtil, streams)
 

Function Documentation

TEST ( TestUnitUtil  ,
streams   
)

Definition at line 4 of file util_test.hpp.

References stan::test::capture_std_streams(), om::cerr, stan::test::cerr_ss, om::cout, stan::test::cout_ss, stan::test::reset_std_streams(), and submit_syst::str.

4  {
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 }
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