Fix label errors in graph visualization (#6369)

This commit is contained in:
Jiaming Yuan
2020-11-12 09:44:59 +08:00
committed by GitHub
parent debeae2509
commit d711d648cb
2 changed files with 13 additions and 5 deletions

View File

@@ -343,6 +343,11 @@ TEST(Tree, DumpDot) {
str = tree.DumpModel(fmap, true, R"(dot:{"graph_attrs": {"bgcolor": "#FFFF00"}})");
ASSERT_NE(str.find(R"(graph [ bgcolor="#FFFF00" ])"), std::string::npos);
// Default left for root.
ASSERT_NE(str.find(R"(0 -> 1 [label="yes, missing")"), std::string::npos);
// Default right for node 1
ASSERT_NE(str.find(R"(1 -> 4 [label="no, missing")"), std::string::npos);
}
TEST(Tree, JsonIO) {