Skip to content

Commit

Permalink
migrate exhaustive_cases integration test (dart-lang/linter#4607)
Browse files Browse the repository at this point in the history
* migrate `exhaustive_cases` integration test

* whoops
  • Loading branch information
pq authored Jul 24, 2023
1 parent 6290549 commit fe95b58
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 63 deletions.
32 changes: 0 additions & 32 deletions test/integration/exhaustive_cases.dart

This file was deleted.

2 changes: 0 additions & 2 deletions test/integration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import '../test_data/rules/experiments/experiments.dart';
import 'integration/avoid_web_libraries_in_flutter.dart'
as avoid_web_libraries_in_flutter;
import 'integration/close_sinks.dart' as close_sinks;
import 'integration/exhaustive_cases.dart' as exhaustive_cases;
import 'integration/public_member_api_docs.dart' as public_member_api_docs;
import 'integration/use_build_context_synchronously.dart'
as use_build_context_synchronously;
Expand Down Expand Up @@ -126,7 +125,6 @@ void coreTests() {

void ruleTests() {
group('rule', () {
exhaustive_cases.main();
avoid_web_libraries_in_flutter.main();
close_sinks.main();
public_member_api_docs.main();
Expand Down
29 changes: 29 additions & 0 deletions test/rules/exhaustive_cases_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,35 @@ void okParenthesized(E e) {
''');
}

test_enumLike_prefixed() async {
newFile('$testPackageLibPath/e.dart', '''
class E {
final int i;
const E._(this.i);
static const e = E._(1);
static const f = E._(2);
static const g = E._(3);
}
''');

await assertDiagnostics(r'''
import 'e.dart' as prefixed;
void e(prefixed.E e) {
switch(e) {
case prefixed.E.e :
print('e');
break;
case prefixed.E.f :
print('e');
}
}
''', [
lint(55, 9),
]);
}

test_notEnumLike_ok() async {
await assertNoDiagnostics(r'''
class TooFew {
Expand Down
16 changes: 0 additions & 16 deletions test_data/integration/exhaustive_cases/a.dart

This file was deleted.

13 changes: 0 additions & 13 deletions test_data/integration/exhaustive_cases/e.dart

This file was deleted.

0 comments on commit fe95b58

Please sign in to comment.