-
Notifications
You must be signed in to change notification settings - Fork 323
Debugging flutter tests fail if the descrription string has an interpolated value and a is composed of two concatenated strings #4250
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
Comments
Merging this into #4021 since that should fix a number of issues with non-trivial test names like this one. |
Re-opening this for tracking to ensure this issue is fixed by the upcoming support for running tests by lines. |
In the next release (and the pre-release version just pushed today - v3.63.20240419), you can choose to have tests executed using their line numbers rather than their names. This fixes a number of issues including this one, caused by not always being able to statically compute the exact name of a test. Please let me know if you find any issues with this functionality! |
I have been away from VSCode so I have not been paying attention. One obvious solution is to insist that test names are static. IMO it is bad practice to put dynamic data there, and I no longer d it. The test should have the same name each time it is run. I hope this makes sense, as I say I am away from VSCode so you do not have my full attention! thank you for all your work! |
Yeah, I think there has been discussion about a lint to enforce this. But there are a lot of tests out there today that do it and I don't think the test runner here should just be broken. There were a bunch of other related issues (not strictly about using variables in names, but just using some helper/wrapper functions that made it difficult to run tests) and the fix for them all was the same so it was worth handling :-) |
Describe the bug
If the description of the test has an interpolated value and a is composed of two concatenated strings the test will not run
To Reproduce
Write a test like the following and try to run it by clicking the debug option
Get this result:
Expected behavior
I expect the test to run.
Please complete the following information:
MacOS 12.6
Dart extension version:
v3.52.1
Dart/Flutter SDK version:
Dart SDK version: 2.18.4 (stable) (Tue Nov 1 15:15:07 2022 +0000) on "macos_arm64"
Target device (if the issue relates to Flutter debugging):
The text was updated successfully, but these errors were encountered: