Skip to content

Commit 6b64d5f

Browse files
committed
make readOutput a filter on a string
1 parent 32cba90 commit 6b64d5f

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

test/dshell/sameenv.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ void main()
88
run("$OUTPUT_BASE/printenv$EXE", File(envFromExe, "wb"));
99
run("$DMD -m$MODEL -run $EXTRA_FILES/printenv.d", File(envFromRun, "wb"));
1010

11-
const fromExe = readOutput(envFromExe);
12-
const fromRun = readOutput(envFromRun);
11+
const fromExe = readText(envFromExe).filterCompilerOutput;
12+
const fromRun = readText(envFromRun).filterCompilerOutput;
1313
if (fromExe != fromRun)
1414
{
1515
writefln("FromExe:");

test/tools/dshell_prebuilt/dshell_prebuilt.d

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,10 @@ private GrepResult grepLines(T)(T lineRange, string finalPattern)
291291
}
292292

293293
/**
294-
read the the given `file` and remove \r and the compiler debug header.
294+
remove \r and the compiler debug header from the given string.
295295
*/
296-
string readOutput(string file)
296+
string filterCompilerOutput(string output)
297297
{
298-
string output = readText(file);
299298
output = std.string.replace(output, "\r", "");
300299
output = std.regex.replaceAll(output, regex(`^DMD v2\.[0-9]+.*\n? DEBUG\n`, "m"), "");
301300
return output;

0 commit comments

Comments
 (0)