mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 10:49:00 +00:00
Add failing tests for SortConstructorFirst with comments.
Bug: https://github.com/dart-lang/sdk/issues/48966 Change-Id: I2d34a7cc240171759dd331f23118745a5d8ff80e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243841 Commit-Queue: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
parent
838b68914f
commit
f7d4d0d85c
1 changed files with 71 additions and 0 deletions
|
@ -80,6 +80,77 @@ class SortConstructorFirstTest extends FixProcessorLintTest {
|
|||
@override
|
||||
String get lintCode => LintNames.sort_constructors_first;
|
||||
|
||||
@FailingTest(
|
||||
reason: 'The beginToken is the comment, which has no previous token.',
|
||||
issue: 'https://github.com/dart-lang/sdk/issues/48966',
|
||||
)
|
||||
Future<void> test_hasComment() async {
|
||||
await resolveTestCode('''
|
||||
class A {
|
||||
void foo() {}
|
||||
/// comment
|
||||
A();
|
||||
}
|
||||
''');
|
||||
await assertHasFix('''
|
||||
class A {
|
||||
/// comment
|
||||
A();
|
||||
void foo() {}
|
||||
}
|
||||
''');
|
||||
}
|
||||
|
||||
@FailingTest(
|
||||
reason: 'The beginToken is the comment, which has no previous token.',
|
||||
issue: 'https://github.com/dart-lang/sdk/issues/48966',
|
||||
)
|
||||
Future<void> test_hasComment_hasMetadata_afterComment() async {
|
||||
await resolveTestCode('''
|
||||
const a = 0;
|
||||
|
||||
class A {
|
||||
void foo() {}
|
||||
/// comment
|
||||
@a
|
||||
A();
|
||||
}
|
||||
''');
|
||||
await assertHasFix('''
|
||||
const a = 0;
|
||||
|
||||
class A {
|
||||
/// comment
|
||||
@a
|
||||
A();
|
||||
void foo() {}
|
||||
}
|
||||
''');
|
||||
}
|
||||
|
||||
Future<void> test_hasComment_hasMetadata_beforeComment() async {
|
||||
await resolveTestCode('''
|
||||
const a = 0;
|
||||
|
||||
class A {
|
||||
void foo() {}
|
||||
@a
|
||||
/// comment
|
||||
A();
|
||||
}
|
||||
''');
|
||||
await assertHasFix('''
|
||||
const a = 0;
|
||||
|
||||
class A {
|
||||
@a
|
||||
/// comment
|
||||
A();
|
||||
void foo() {}
|
||||
}
|
||||
''');
|
||||
}
|
||||
|
||||
Future<void> test_one_fix() async {
|
||||
await resolveTestCode('''
|
||||
class A {
|
||||
|
|
Loading…
Reference in a new issue