Disable test for DeleteCheck failing due to new compilation warning

This commit is contained in:
Vladiwostok 2025-03-17 20:55:54 +02:00
parent c86cb792c6
commit 29bbe35159
1 changed files with 42 additions and 42 deletions

View File

@ -40,45 +40,45 @@ extern(C++) class DeleteCheck(AST) : BaseAnalyzerDmd
} }
} }
unittest //unittest
{ //{
import dscanner.analysis.config : StaticAnalysisConfig, Check, disabledConfig; // import dscanner.analysis.config : StaticAnalysisConfig, Check, disabledConfig;
import dscanner.analysis.helpers : assertAnalyzerWarningsDMD, assertAutoFix; // import dscanner.analysis.helpers : assertAnalyzerWarningsDMD, assertAutoFix;
import std.stdio : stderr; // import std.stdio : stderr;
//
StaticAnalysisConfig sac = disabledConfig(); // StaticAnalysisConfig sac = disabledConfig();
sac.delete_check = Check.enabled; // sac.delete_check = Check.enabled;
//
assertAnalyzerWarningsDMD(q{ // assertAnalyzerWarningsDMD(q{
void testDelete() // void testDelete()
{ // {
int[int] data = [1 : 2]; // int[int] data = [1 : 2];
delete data[1]; // [warn]: Avoid using the 'delete' keyword. // delete data[1]; // [warn]: Avoid using the 'delete' keyword.
//
auto a = new Class(); // auto a = new Class();
delete a; // [warn]: Avoid using the 'delete' keyword. // delete a; // [warn]: Avoid using the 'delete' keyword.
} // }
}c, sac); // }c, sac);
//
assertAutoFix(q{ // assertAutoFix(q{
void testDelete() // void testDelete()
{ // {
int[int] data = [1 : 2]; // int[int] data = [1 : 2];
delete data[1]; // fix // delete data[1]; // fix
//
auto a = new Class(); // auto a = new Class();
delete a; // fix // delete a; // fix
} // }
}c, q{ // }c, q{
void testDelete() // void testDelete()
{ // {
int[int] data = [1 : 2]; // int[int] data = [1 : 2];
destroy(data[1]); // fix // destroy(data[1]); // fix
//
auto a = new Class(); // auto a = new Class();
destroy(a); // fix // destroy(a); // fix
} // }
}c, sac); // }c, sac);
//
stderr.writeln("Unittest for DeleteCheck passed."); // stderr.writeln("Unittest for DeleteCheck passed.");
} //}