-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move avoid_relative_lib_imports tests to reflective (#4104)
* Move avoid_relative_lib_imports tests to reflective * remove-old-data
- Loading branch information
Showing
8 changed files
with
45 additions
and
70 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// 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(AvoidRelativeLibImportsTest); | ||
}); | ||
} | ||
|
||
@reflectiveTest | ||
class AvoidRelativeLibImportsTest extends LintRuleTest { | ||
@override | ||
bool get addJsPackageDep => true; | ||
|
||
@override | ||
String get lintRule => 'avoid_relative_lib_imports'; | ||
|
||
test_externalPackage() async { | ||
await assertNoDiagnostics(r''' | ||
/// This provides [JS]. | ||
import 'package:js/js.dart'; | ||
'''); | ||
} | ||
|
||
test_samePackage_relativeUri() async { | ||
newFile('$testPackageLibPath/lib.dart', r''' | ||
class C {} | ||
'''); | ||
var test = newFile('$testPackageRootPath/test/test.dart', r''' | ||
/// This provides [C]. | ||
import '../lib/lib.dart'; | ||
'''); | ||
var lib2Result = await resolveFile(test.path); | ||
await assertDiagnosticsIn(lib2Result.errors, [ | ||
lint(30, 17), | ||
]); | ||
} | ||
} |
14 changes: 0 additions & 14 deletions
14
test_data/integration/avoid_relative_lib_imports/.dart_tool/package_config.json
This file was deleted.
Oops, something went wrong.
Empty file.
3 changes: 0 additions & 3 deletions
3
test_data/integration/avoid_relative_lib_imports/lib/main.dart
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.