Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate malformed pubspec integration test #4609

Merged
merged 1 commit into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions test/all.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import 'engine_test.dart' as engine_test;
import 'formatter_test.dart' as formatter_test;
import 'integration_test.dart' as integration_test;
import 'mocks.dart';
import 'pubspec_test.dart' as pubspec_test;
import 'rule_test.dart' as rule_test;
import 'rules/all.dart' as reflective_rule_tests;
import 'unmocked_sdk_rule_test.dart' as unmocked_sdk_rule_test;
Expand All @@ -37,6 +38,7 @@ void main() {
engine_test.main();
formatter_test.main();
integration_test.main();
pubspec_test.main();
rule_test.main();
reflective_rule_tests.main();
unmocked_sdk_rule_test.main();
Expand Down
18 changes: 0 additions & 18 deletions test/integration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,24 +77,6 @@ void coreTests() {
});
});

group('pubspec', () {
var currentOut = outSink;
var collectingOut = CollectingSink();
setUp(() => outSink = collectingOut);
tearDown(() {
collectingOut.buffer.clear();
outSink = currentOut;
});
test('bad pubspec', () async {
await cli.run([
'$integrationTestDir/p3',
'$integrationTestDir/p3/_pubpspec.yaml'
]);
expect(collectingOut.trim(),
startsWith('1 file analyzed, 0 issues found, in'));
});
});

group('canonicalization', () {
var currentOut = outSink;
var collectingOut = CollectingSink();
Expand Down
29 changes: 29 additions & 0 deletions test/pubspec_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright (c) 2023, 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';

main() {
defineReflectiveSuite(() {
defineReflectiveTests(BadPubspecTest);
});
}

@reflectiveTest
class BadPubspecTest extends LintRuleTest {
@override
String get lintRule => 'sort_pub_dependencies';

// ignore: non_constant_identifier_names
test_malformedPubspec() async {
await assertNoPubspecDiagnostics(r'''
not: a
valid
pub
spec:
''');
}
}
4 changes: 0 additions & 4 deletions test_data/integration/p3/_pubspec.yaml

This file was deleted.