mirror of
https://github.com/dlang-community/D-Scanner.git
synced 2025-04-26 13:20:07 +03:00
Fix unittests (#153)
* Fix broken unittests in vcall_in_ctor.d * Fix broken unittest in line_length.d * Fix broken unittest in redundant_attributes.d * Fix broken unittest in if_constraints_indent.d * Fix broken unittests in auto_function.d * Fix broken unittest in always_curly.d
This commit is contained in:
parent
517b017058
commit
444f4e20b6
6 changed files with 8 additions and 27 deletions
|
@ -264,11 +264,11 @@ unittest
|
|||
|
||||
assertAutoFix(q{
|
||||
void test() {
|
||||
do return; while(true) // fix:0
|
||||
do return; while(true); // fix:0
|
||||
}
|
||||
}c, q{
|
||||
void test() {
|
||||
do { return; } while(true) // fix:0
|
||||
do { return; } while(true); // fix:0
|
||||
}
|
||||
}c, sac, true);
|
||||
|
||||
|
|
|
@ -195,18 +195,15 @@ unittest
|
|||
|
||||
assertAnalyzerWarningsDMD(q{
|
||||
auto doStuff(){} // [warn]: %s
|
||||
extern(C) auto doStuff();
|
||||
}c.format(MESSAGE), sac);
|
||||
|
||||
assertAnalyzerWarningsDMD(q{
|
||||
auto doStuff(){} // [warn]: %s
|
||||
@disable auto doStuff();
|
||||
}c.format(MESSAGE), sac);
|
||||
|
||||
assertAnalyzerWarningsDMD(q{
|
||||
@property doStuff(){} // [warn]: %s
|
||||
@safe doStuff(){} // [warn]: %s
|
||||
@disable doStuff();
|
||||
@safe void doStuff();
|
||||
}c.format(MESSAGE_INSERT, MESSAGE_INSERT), sac);
|
||||
|
||||
|
|
|
@ -267,6 +267,6 @@ unittest
|
|||
sac.if_constraints_indent = Check.enabled;
|
||||
|
||||
assertAnalyzerWarnings(`void foo() {
|
||||
''
|
||||
f;
|
||||
}`, sac);
|
||||
}
|
||||
|
|
|
@ -156,8 +156,8 @@ assert("foo" == "foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
|
|||
}c, sac);
|
||||
|
||||
assertAnalyzerWarningsDMD(q{
|
||||
assert("foo" == "boooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo5");
|
||||
assert("foo" == "booooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo6"); // [warn]: Line is longer than 120 characters
|
||||
static assert("foo" == "booooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo5");
|
||||
static assert("foo" == "boooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo6"); // [warn]: Line is longer than 120 characters
|
||||
}c, sac);
|
||||
|
||||
// reduced from std/regex/internal/thompson.d
|
||||
|
|
|
@ -111,7 +111,7 @@ private:
|
|||
private int foo2; // [warn]: Same visibility attribute used as defined on line 4.
|
||||
private void foo() // [warn]: Same visibility attribute used as defined on line 4.
|
||||
{
|
||||
private int blah;
|
||||
int blah;
|
||||
}
|
||||
}}c, sac);
|
||||
|
||||
|
|
|
@ -226,7 +226,7 @@ unittest
|
|||
bar(); // [warn]: %s
|
||||
}
|
||||
private: public void bar();
|
||||
public private {void foo(){}}
|
||||
private {void foo(){}}
|
||||
}
|
||||
}c.format(MSG), sac);
|
||||
|
||||
|
@ -247,22 +247,6 @@ unittest
|
|||
}
|
||||
}, sac);
|
||||
|
||||
assertAnalyzerWarningsDMD(q{
|
||||
class Bar
|
||||
{
|
||||
this(){foo();}
|
||||
private public protected private void foo(){}
|
||||
}
|
||||
}, sac);
|
||||
|
||||
assertAnalyzerWarningsDMD(q{
|
||||
class Bar
|
||||
{
|
||||
this(){foo();}
|
||||
final private public protected void foo(){}
|
||||
}
|
||||
}, sac);
|
||||
|
||||
assertAnalyzerWarningsDMD(q{
|
||||
class Bar
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue