read_line_test.cpp
Go to the documentation of this file.
1 #include <stan/io/read_line.hpp>
2 #include <gtest/gtest.h>
3 #include <sstream>
4 #include <string>
5 
6 TEST(Io, ReadLine) {
8  std::stringstream s;
9  s << "";
10  EXPECT_EQ("", read_line(s));
11  EXPECT_EQ("", read_line(s));
12 }
13 TEST(Io, Readline2) {
14  using stan::io::read_line;
15  std::stringstream s;
16  s << "foo bar\n";
17  EXPECT_EQ("foo bar\n", read_line(s));
18  EXPECT_EQ("", read_line(s));
19 }
20 TEST(Io, Readline3) {
21  using stan::io::read_line;
22  std::stringstream s;
23  s << "foo bar\nbaz bing";
24  EXPECT_EQ("foo bar\n", read_line(s));
25  EXPECT_EQ("baz bing", read_line(s));
26  EXPECT_EQ("", read_line(s));
27 }
28 
std::string read_line(std::istream &in)
Definition: read_line.hpp:22
const XML_Char * s
Definition: expat.h:262
TEST(Io, ReadLine)