Skip to content

No tests match regular expression " test & exit /B 0". #4007

Closed

Description

@DarkHeros09

Hi

vscode is having a problem running tests with a multi-line string description.

How to reproduce:

This will pass:

import 'package:flutter_test/flutter_test.dart';

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

This will not pass:

import 'package:flutter_test/flutter_test.dart';

void main() {

    testWidgets('''
        test
        ''', (tester) async {});

}

keep in mind that the later test will pass if run through void main.

[√] VS Code (version 1.67.2)
    • VS Code at C:\Users\m_ben\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.42.0

Activity

  1. DanTup commented on Jun 7, 2022

    @DanTup
    Member

    I don't seem to be able to repro this (I'm using the "Run" link on the test, which I presume is what you're doing too):

    Screenshot 2022-06-07 at 10 31 09

    Could you try capturing some logs?

    • Run the Dart: Capture Debugging Logs command
    • Run the test and reproduce the failure
    • Click Cancel on the logging notification to stop logging and open the log
    • Remove anything sensitive from the log
    • Attach the log here (or in a gist)

    Thanks!

  2. added
    awaiting infoRequires more information from the customer to progress
    on Jun 7, 2022
  3. DanTup commented on Jun 7, 2022

    @DanTup
    Member

    Actually, I can repro on Windows, and only Flutter tests, not Dart tests.

  4. added
    in flutterRelates to running Flutter apps
    in testingRelates to test execution of Dart/Flutter tests for end users
    and removed
    awaiting infoRequires more information from the customer to progress
    on Jun 7, 2022
  5. added this to the v3.44.0 milestone on Jun 7, 2022
  6. jeff9315 commented on Aug 28, 2022

    @jeff9315

    I am still having this problem on 3.46.1 using Windows 11. Multiline comments of 3 or more lines fail with this error message when run individually but work when run from a group or from main() in the test file.

  7. DarkHeros09 commented on Aug 28, 2022

    @DarkHeros09
    Author

    yes i can confirm this too on my win10 machine.

        • VS Code at C:\Users\m_ben\AppData\Local\Programs\Microsoft VS Code
        • Flutter extension version 3.46.0
    
  8. DanTup commented on Aug 30, 2022

    @DanTup
    Member

    The original test case above seems to work for me, but the test case in #4125 does not, so I think there's something else giong on. Let's use #4125 instead of re-opening this, since the case reported above does seem fixed.

  9. added a commit that references this issue on Sep 2, 2025
    f1efab4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in flutterRelates to running Flutter appsin testingRelates to test execution of Dart/Flutter tests for end usersis bugon windows

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions