-
Notifications
You must be signed in to change notification settings - Fork 13
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
Switch between file and line number #65
Comments
@a8t You can use the For example, if you have test file names |
I'd also find this very useful -- eg. if you're only running one test, to be able to type eg: |
@byronalley How would you see this potential new command working if there are more than one file selected? I'm a bit reluctant to add commands that only work in limited circumstances or that have to report errors due to disallowed use. As I said above, it is possible to provide a One option I've thought of is to allow a In Elixir 1.16, |
Thanks @randycoulman -- I definitely appreciate that reluctance, and fwiw Since adding a line number only makes sense per file, I'd thought of it as an additional filter that only applies if there's a single test being run. So to summarize I believe the options are:
I think 1b) makes the most sense, maybe with an error message like "Line numbers can only be changed for a single file"? But 5) is interesting too. Maybe there's a better way but I'm not seeing it. For syntax, originally I'd thought small L for line number like |
@byronalley Thanks for taking the time to outline your thinking. TL;DR:
Details: For option 5, see #31. Depending on how it's done, I think it would be possible to make the In experimenting, I realized that there is at least one case where we emit an error message: when there are no matching patterns. So there is precedent for this. I also discovered that we already support the multiple In order to support line number modification, we'll have to do more processing of the Depending on how we do this, it might be easy to also support a mix of If we do this, we could then be a bit more clever with the line number command: look at the existing patterns, and if there is exactly one that contains a line number, then modify that line number and leave the remaining patterns alone. If none contain a line number, then when applying the pattern filter to the list of test files, check if there is only one matching file. If there is, apply the line number to it. Otherwise, ignore the line number and print the warning. I'm still wondering if this is making things too complex for the user, but I would like to support something like this, so I'm open to some experiments/ideas/PRs in this area. |
@randycoulman I like that thinking. Like you say, probably needs a bit of experimentation to get it right, but I think there's a good chance of making it work. |
Hi, thanks for the library! I think this is a feature request, but with pointers I'd be happy to look into implementing it.
I often want to switch between
running all tests in a file
andrunning test at a given line
. Is there an easy way to achieve this? I think it'd only make sense if the currently running tests are all in one file.The text was updated successfully, but these errors were encountered: