Skip to content

Commit 1ac9761

Browse files
zyebytevtWebFreak001
authored andcommitted
Add missing tests
1 parent 7a9f7b6 commit 1ac9761

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

src/dparse/formatter.d

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2691,7 +2691,7 @@ class Formatter(Sink)
26912691
void format(const ShortenedFunctionBody shortenedFunctionBody)
26922692
{
26932693
debug(verbose) writeln("ShortenedFunctionBody");
2694-
put("=> ");
2694+
put(" => ");
26952695
format(shortenedFunctionBody.expression);
26962696
put(";");
26972697
}
@@ -4349,4 +4349,22 @@ do
43494349
{
43504350
}
43514351
}}, `a == b && c == d`);
4352+
testFormatNode!(FunctionDeclaration)(q{void foo() => writeln("Hello");});
4353+
testFormatNode!(VariableDeclaration)(q{/// Documentation for this variable
4354+
/// which is even multilined.
4355+
int x;});
4356+
testFormatNode!(EnumDeclaration)(q{enum Foo {
4357+
x, /// Documentation for x
4358+
y, /// Documentation for y
4359+
z, /// Documentation for z
4360+
}}, "enum Foo
4361+
4362+
{
4363+
x, /// Documentation for x
4364+
4365+
y, /// Documentation for y
4366+
4367+
z /// Documentation for z
4368+
4369+
}");
43524370
}

0 commit comments

Comments
 (0)