flutter / flutter/flutter-intellij

Test icon for a single test runs all tests in the file if description has been split

Open
#7,230 1 comment 0 reactions 0 assignees View on GitHub
P2 topic-testing
Dominant language
Java
Stars
2k
Forks
356
Avg merge
1d 11h
Merged PRs (30d)
27

Description

## Steps to Reproduce

1. Create a test file.
2. Copy the code below and paste it into the file.
3. Press the icon in the gutter.

```dart
import 'package:flutter_test/flutter_test.dart';

void main() {
testWidgets('aaa aaa', (tester) async {
//
});

testWidgets('bbb ' 'bbb', (tester) async {
//
});
}
```

The icon for the test `'bbb' 'bbb'` runs all tests in the same file although I expect it to run only the relevant test as the icon for `'aaa aaa'` does.

| 'aaa aaa' | 'bbb ' 'bbb' |
|:-:|:-:|
| | |

I often split test descriptions into multiple lines since I want them to have enough info for maintainability, but sadly it causes the inconvenience.

## Version info

flutter doctor -v

```
[√] Flutter (Channel stable, 3.16.9, on Microsoft Windows [Version 10.0.22631.3155], locale ja-JP)
• Flutter version 3.16.9 on channel stable at D:\xxxx\flutter\sdk
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 41456452f2 (4 weeks ago), 2024-01-25 10:06:23 -0800
• Engine revision f40e976bed
• Dart version 3.2.6
• DevTools version 2.28.5

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
• Android SDK at D:\xxxx\android\sdk
• Platform android-34, build-tools 33.0.1
• ANDROID_HOME = D:\xxxx\android\sdk
• Java binary at: C:\Program Files\JetBrains\IntelliJ IDEA 2023.2.5\jbr\bin\java
• Java version OpenJDK Runtime Environment JBR-17.0.10+1-1087.17-jcef (build 17.0.10+1-b1087.17)
• All Android licenses accepted.

[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.5.4)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.5.33530.505
• Windows 10 SDK version 10.0.19041.0

[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).

[√] IntelliJ IDEA Ultimate Edition (version 2023.3)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2023.2.5
• Flutter plugin version 78.1.1
• Dart plugin version 233.13763.5

[√] VS Code (version 1.86.0)
• VS Code at C:\Users\xxxx\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.82.0

[√] Connected device (2 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22631.3155]
• Edge (web) • edge • web-javascript • Microsoft Edge 121.0.2277.128

[√] Network resources
• All expected network resources are available.

! Doctor found issues in 2 categories.
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.