* Fix #422 - False negative: sorted imports with : * Fix #422: Add another test
This commit is contained in:
parent
6fad779ec2
commit
6d34b149a9
|
@ -72,7 +72,7 @@ class ImportSortednessCheck : BaseAnalyzer
|
|||
|
||||
foreach (importBind; id.importBindings.importBinds)
|
||||
{
|
||||
addImport(importModuleName ~ "_" ~ importBind.left.text, id.importBindings.singleImport);
|
||||
addImport(importModuleName ~ "-" ~ importBind.left.text, id.importBindings.singleImport);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -341,5 +341,20 @@ unittest
|
|||
ImportSortednessCheck.MESSAGE,
|
||||
), sac);
|
||||
|
||||
// issue 422 - sorted imports with :
|
||||
assertAnalyzerWarnings(q{
|
||||
import foo.bar : bar;
|
||||
import foo.barbar;
|
||||
}, sac);
|
||||
|
||||
// issue 422 - sorted imports with :
|
||||
assertAnalyzerWarnings(q{
|
||||
import foo;
|
||||
import foo.bar;
|
||||
import fooa;
|
||||
import std.range : Take;
|
||||
import std.range.primitives : isInputRange, walkLength;
|
||||
}, sac);
|
||||
|
||||
stderr.writeln("Unittest for ImportSortednessCheck passed.");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue