blob: cb094f892eb0fda314fec5be3d6ea6b70faddb50 [file]
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:test_reflective_loader/test_reflective_loader.dart';
import '../rule_test_support.dart';
void main() {
defineReflectiveSuite(() {
defineReflectiveTests(LibraryNamesTest);
});
}
@reflectiveTest
class LibraryNamesTest extends LintRuleTest {
@override
String get lintRule => LintNames.library_names;
test_libraryWithoutName() async {
await assertNoDiagnostics('''
library;
''');
}
test_lowercase() async {
await assertNoDiagnostics('''
library foo;
''');
}
test_noLibrary() async {
await assertNoDiagnostics('''
''');
}
test_titlecase() async {
await assertDiagnosticsFromMarkup('''
library [!Foo!];
''');
}
test_uppercaseInDots() async {
await assertDiagnosticsFromMarkup('''
library [!one.Two.three!];
''');
}
}