11 ensure(
int which,
bool claim)
18 ensure(
int which, std::istream& os)
41 "#include \"./a.txt\"\n" 45 "#include \"./a.txt\"\n" 46 "#include \"./b.txt\"\r\n" 50 "#include \"./a.txt\"\n" 51 "#include \"./b.txt\"\r\n" 52 "#include \"./c.txt\"\r" 58 return std::regex_replace(str, std::regex(
"\r"),
"\n");
64 std::ofstream
a(file_a);
66 std::ofstream
b(file_b);
68 std::ofstream
c(file_c);
70 std::ofstream i(file_i);
72 std::ofstream j(file_j);
74 std::ofstream
k(file_k);
87 std::ifstream
a(file_a);
91 ensure(2, result == expected_string(contents_a));
93 std::ifstream
b(file_b);
97 ensure(4, result == expected_string(contents_b));
99 std::ifstream
c(file_c);
103 ensure(6, result == expected_string(contents_c));
108 std::ifstream i(file_i);
113 result == expected_string(
"begin\n") + expected_string(contents_a) +
114 expected_string(
"end\n"));
119 std::ifstream j(file_j);
124 result == expected_string(
"begin\n") + expected_string(contents_a) +
125 expected_string(contents_b) + expected_string(
"end\n"));
130 std::ifstream
k(file_k);
135 result == expected_string(
"begin\n") + expected_string(contents_a) +
136 expected_string(contents_b) +
137 expected_string(contents_c) + expected_string(
"end\n"));
void ensure(int which, bool claim)
void include(std::istream &in, std::string &result)