Skip to content

Commit

Permalink
Use rawWrite for writing test files in unit tests (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladiwostok authored Nov 6, 2024
1 parent f1b1c6e commit 8db5a65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/dscanner/analysis/allman.d
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ unittest
sac.allman_braces_check = Check.enabled;

// check common allman style violation
assertAnalyzerWarningsDMD(`
assertAnalyzerWarningsDMD(q{
void testAllman()
{
while (true) { // [warn]: %s
Expand Down Expand Up @@ -146,7 +146,7 @@ unittest
}
}
}
`c.format(
}c.format(
AllManCheck.MESSAGE,
AllManCheck.MESSAGE,
AllManCheck.MESSAGE,
Expand Down
4 changes: 2 additions & 2 deletions src/dscanner/analysis/helpers.d
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ void assertAutoFix(string before, string after, const StaticAnalysisConfig confi
remove(testFileName);
}

f.write(before);
f.rawWrite(before);
f.close();

auto dmdModule = parseDmdModule(file, before);
Expand Down Expand Up @@ -400,7 +400,7 @@ void assertAnalyzerWarningsDMD(string code, const StaticAnalysisConfig config, b
remove(testFileName);
}

f.write(code);
f.rawWrite(code);
f.close();

auto dmdModule = parseDmdModule(file, code);
Expand Down

0 comments on commit 8db5a65

Please sign in to comment.