Use rawWrite for writing test files in unit tests (#168)
This commit is contained in:
parent
cfe5a5dae7
commit
bf75a9b9d3
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue