Skip to content

Commit 6e7e4fa

Browse files
authored
Add regression test for relative imports in tests under lib (#2147)
Validates the issue listed in #2142. Skipped for now since it fails in all configurations.
1 parent 84c366a commit 6e7e4fa

File tree

9 files changed

+154
-34
lines changed

9 files changed

+154
-34
lines changed

.github/workflows/dart.yml

Lines changed: 80 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
paths:
2+
- lib/issue_2142/test.dart
3+
4+
platforms:
5+
- chrome
6+
- vm
7+
8+
compilers:
9+
- dart2js
10+
- dart2wasm
11+
- exe
12+
- kernel
13+
- source
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
// ignore: prefer_relative_imports
6+
import 'package:regression_tests/issue_2142/test.dart';
7+
8+
Thing newThing() => Thing();
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
@Skip('https://github.com/dart-lang/test/issues/2142')
6+
library;
7+
8+
import 'package:test/test.dart';
9+
import 'import.dart';
10+
11+
void main() {
12+
test('aThing is a Thing', () {
13+
expect(newThing(), isA<Thing>());
14+
});
15+
}
16+
17+
class Thing {}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# See https://pub.dev/packages/mono_repo
2+
3+
sdk:
4+
- dev
5+
6+
os:
7+
- linux
8+
9+
stages:
10+
- analyze_and_format:
11+
- group:
12+
- format
13+
- analyze: --fatal-infos
14+
- unit_test:
15+
- test
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: regression_tests
2+
publish_to: none
3+
environment:
4+
sdk: ^3.0.0
5+
dependencies:
6+
test: any
7+
dev_dependencies:
8+
dart_flutter_team_lints: ^2.1.1
9+
dependency_overrides:
10+
test:
11+
path: ../../pkgs/test
12+
test_api:
13+
path: ../../pkgs/test_api
14+
test_core:
15+
path: ../../pkgs/test_core

integration_tests/wasm/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ publish_to: none
33
environment:
44
sdk: ^3.0.0
55
dev_dependencies:
6+
dart_flutter_team_lints: ^2.1.1
67
test: any
78
dependency_overrides:
89
test:

integration_tests/wasm/test/hello_world_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
@TestOn('wasm')
66
// This retry is a regression test for https://github.com/dart-lang/test/issues/2006
77
@Retry(2)
8+
library;
9+
810
import 'package:test/test.dart';
911

1012
void main() {

tool/ci.sh

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)