Use rawWrite for writing test files in unit tests (#168)

This commit is contained in:
Vladiwostok 2024-11-06 16:23:38 +02:00 committed by Vladiwostok
parent cfe5a5dae7
commit bf75a9b9d3
2 changed files with 4 additions and 4 deletions

View File

@ -108,7 +108,7 @@ unittest
sac.allman_braces_check = Check.enabled; sac.allman_braces_check = Check.enabled;
// check common allman style violation // check common allman style violation
assertAnalyzerWarningsDMD(` assertAnalyzerWarningsDMD(q{
void testAllman() void testAllman()
{ {
while (true) { // [warn]: %s while (true) { // [warn]: %s
@ -146,7 +146,7 @@ unittest
} }
} }
} }
`c.format( }c.format(
AllManCheck.MESSAGE, AllManCheck.MESSAGE,
AllManCheck.MESSAGE, AllManCheck.MESSAGE,
AllManCheck.MESSAGE, AllManCheck.MESSAGE,

View File

@ -262,7 +262,7 @@ void assertAutoFix(string before, string after, const StaticAnalysisConfig confi
remove(testFileName); remove(testFileName);
} }
f.write(before); f.rawWrite(before);
f.close(); f.close();
auto dmdModule = parseDmdModule(file, before); auto dmdModule = parseDmdModule(file, before);
@ -400,7 +400,7 @@ void assertAnalyzerWarningsDMD(string code, const StaticAnalysisConfig config, b
remove(testFileName); remove(testFileName);
} }
f.write(code); f.rawWrite(code);
f.close(); f.close();
auto dmdModule = parseDmdModule(file, code); auto dmdModule = parseDmdModule(file, code);