Skip to content

Commit 3fa427b

Browse files
authored
Make yaml_test easier to debug by outputing the actual text (#6218)
1 parent 2d1de16 commit 3fa427b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

toolchain/sem_ir/yaml_test.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ TEST(SemIRTest, Yaml) {
105105
auto root = Yaml::Sequence(ElementsAre(Yaml::Mapping(
106106
ElementsAre(Pair("filename", "test.carbon"), Pair("sem_ir", file)))));
107107

108-
EXPECT_THAT(Yaml::Value::FromText(print_stream.TakeStr()), IsYaml(root));
108+
std::string print_text = print_stream.TakeStr();
109+
EXPECT_THAT(Yaml::Value::FromText(print_text), IsYaml(root))
110+
<< "Actual text:\n"
111+
<< print_text;
109112
}
110113

111114
} // namespace

0 commit comments

Comments
 (0)