Skip to content

Commit

Permalink
Refactor courtesy WebFreak001.
Browse files Browse the repository at this point in the history
Co-authored-by: Jan Jurzitza <gh@webfreak.org>
  • Loading branch information
veelo and WebFreak001 committed May 27, 2022
1 parent f6d9d04 commit b8da7c5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/test.d
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ else
int main()
{
foreach (braceStyle; ["allman", "otbs", "knr"])
foreach (entry; dirEntries(".", "*.d", SpanMode.shallow).
filter!(e => e.baseName(".d") != thisExePath.baseName(".exe")))
foreach (entry; dirEntries(".", "*.d", SpanMode.shallow).filter!(e => e.baseName(".d") != "test"))
{
const source = entry.baseName;
const outFileName = buildPath(braceStyle, source ~ ".out");
const refFileName = buildPath(braceStyle, source ~ ".ref");
const argsFile = source.stripExtension ~ ".args";
const dfmtCommand =
[dfmt, "--brace_style=" ~ braceStyle] ~
(argsFile.exists ? readText(argsFile).splitter!isWhite.filter!(a => a.length).array : []) ~
(argsFile.exists ? readText(argsFile).split : []) ~
[source];
writeln(dfmtCommand.join(" "));
if (const result = spawnProcess(dfmtCommand, stdin, File(outFileName, "w")).wait)
Expand Down

0 comments on commit b8da7c5

Please sign in to comment.