fix: store unit tests in AST

Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
This commit is contained in:
Prajwal S N 2023-12-29 13:24:03 +05:30
parent 3b80011673
commit 16028a8f62
No known key found for this signature in database
GPG Key ID: 60701A603988FAC2
1 changed files with 2 additions and 0 deletions

View File

@ -14,6 +14,7 @@ import dmd.astcodegen;
import dmd.transitivevisitor;
import dmd.permissivevisitor;
import dmd.frontend;
import dmd.globals;
import dfmt.ast;
import dfmt.config;
import std.array;
@ -33,6 +34,7 @@ bool format(string source_desc, ubyte[] buffer, File.LockingTextWriter output,
Config* formatterConfig)
{
initDMD();
global.params.useUnitTests = true;
auto module_ = parseModule(source_desc)[0];
scope v = new FormatVisitor(output, formatterConfig);
v.visit(module_);