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

Add regression test for relative imports in tests under lib #2147

Merged
merged 6 commits into from
Dec 5, 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
111 changes: 80 additions & 31 deletions .github/workflows/dart.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions integration_tests/regression/dart_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
paths:
- lib/issue_2142/test.dart

platforms:
- chrome
- vm

compilers:
- dart2js
- dart2wasm
- exe
- kernel
- source
8 changes: 8 additions & 0 deletions integration_tests/regression/lib/issue_2142/import.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// 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.

// ignore: prefer_relative_imports
import 'package:regression_tests/issue_2142/test.dart';

Thing newThing() => Thing();
17 changes: 17 additions & 0 deletions integration_tests/regression/lib/issue_2142/test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// 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.

@Skip('https://github.com/dart-lang/test/issues/2142')
library;

import 'package:test/test.dart';
import 'import.dart';

void main() {
test('aThing is a Thing', () {
expect(newThing(), isA<Thing>());
});
}

class Thing {}
15 changes: 15 additions & 0 deletions integration_tests/regression/mono_pkg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# See https://pub.dev/packages/mono_repo

sdk:
- dev

os:
- linux

stages:
- analyze_and_format:
- group:
- format
- analyze: --fatal-infos
- unit_test:
- test
15 changes: 15 additions & 0 deletions integration_tests/regression/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: regression_tests
publish_to: none
environment:
sdk: ^3.0.0
dependencies:
test: any
dev_dependencies:
dart_flutter_team_lints: ^2.1.1
dependency_overrides:
test:
path: ../../pkgs/test
test_api:
path: ../../pkgs/test_api
test_core:
path: ../../pkgs/test_core
1 change: 1 addition & 0 deletions integration_tests/wasm/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ publish_to: none
environment:
sdk: ^3.0.0
dev_dependencies:
dart_flutter_team_lints: ^2.1.1
test: any
dependency_overrides:
test:
Expand Down
2 changes: 2 additions & 0 deletions integration_tests/wasm/test/hello_world_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
@TestOn('wasm')
// This retry is a regression test for https://github.com/dart-lang/test/issues/2006
@Retry(2)
library;

import 'package:test/test.dart';

void main() {
Expand Down
6 changes: 3 additions & 3 deletions tool/ci.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.