Apply suggestions from code review

Co-authored-by: Andy Friesen <andy.friesen@gmail.com>
This commit is contained in:
JohnnyMorganz 2022-05-17 18:31:41 +01:00 committed by GitHub
parent bcae1e935c
commit 22e988207e
Signed by: DevComp
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View file

@ -744,7 +744,8 @@ struct TypeVarStringifier
bool first = true;
for (std::string& ss : results)
{
if (!first) {
if (!first)
{
state.newline();
state.emit("| ");
}
@ -799,7 +800,8 @@ struct TypeVarStringifier
bool first = true;
for (std::string& ss : results)
{
if (!first) {
if (!first)
{
state.newline();
state.emit("& ");
}

View file

@ -136,8 +136,8 @@ TEST_CASE_FIXTURE(Fixture, "intersections_respects_use_line_breaks")
opts.useLineBreaks = true;
//clang-format off
CHECK_EQ("((number) -> number)"
"\n& ((string) -> string)",
CHECK_EQ("((number) -> number)\n"
"& ((string) -> string)",
toString(requireType("a"), opts));
//clang-format on
}
@ -152,9 +152,9 @@ TEST_CASE_FIXTURE(Fixture, "unions_respects_use_line_breaks")
opts.useLineBreaks = true;
//clang-format off
CHECK_EQ("boolean"
"\n| number"
"\n| string",
CHECK_EQ("boolean\n"
"| number\n"
"| string",
toString(requireType("a"), opts));
//clang-format on
}