Files
sdk/pkg/linter/test/lint_code_test.dart
T
pq 02483247a7 [cq] bump linter to 3.7 and tall-style format
Change-Id: I08e8310c6133418fd99954c306601b277a85f3c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403932
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2025-01-13 12:46:50 -08:00

42 lines
1.1 KiB
Dart

// Copyright (c) 2024, 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:linter/src/lint_codes.dart';
import 'package:test/test.dart';
import 'rule_test_support.dart';
void main() {
group('lint code', () {
group('creation', () {
test('without published diagnostic docs', () {
expect(
_customCode.url,
equals('https://dart.dev/lints/${_customCode.name}'),
);
});
test('with published diagnostic docs', () {
expect(
_customCodeWithDocs.url,
equals('https://dart.dev/diagnostics/${_customCodeWithDocs.name}'),
);
});
});
});
}
const LintCode _customCode = LinterLintCode(
'hash_and_equals',
'Override `==` if overriding `hashCode`.',
correctionMessage: 'Implement `==`.',
);
const LintCode _customCodeWithDocs = LinterLintCode(
'hash_and_equals',
'Override `==` if overriding `hashCode`.',
correctionMessage: 'Implement `==`.',
hasPublishedDocs: true,
);