Skip to content

Commit

Permalink
Add missing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zyebytevt authored and WebFreak001 committed Dec 31, 2023
1 parent 7a9f7b6 commit 1ac9761
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/dparse/formatter.d
Original file line number Diff line number Diff line change
Expand Up @@ -2691,7 +2691,7 @@ class Formatter(Sink)
void format(const ShortenedFunctionBody shortenedFunctionBody)
{
debug(verbose) writeln("ShortenedFunctionBody");
put("=> ");
put(" => ");
format(shortenedFunctionBody.expression);
put(";");
}
Expand Down Expand Up @@ -4349,4 +4349,22 @@ do
{
}
}}, `a == b && c == d`);
testFormatNode!(FunctionDeclaration)(q{void foo() => writeln("Hello");});
testFormatNode!(VariableDeclaration)(q{/// Documentation for this variable
/// which is even multilined.
int x;});
testFormatNode!(EnumDeclaration)(q{enum Foo {
x, /// Documentation for x
y, /// Documentation for y
z, /// Documentation for z
}}, "enum Foo
{
x, /// Documentation for x
y, /// Documentation for y
z /// Documentation for z
}");
}

0 comments on commit 1ac9761

Please sign in to comment.