-
Notifications
You must be signed in to change notification settings - Fork 89
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
Further enhancing is_deeply diagnostics #917
Comments
This is what Test2 is for:
Test2 was written specifically because Test::More had serious limitations on how it can be changed. When I first inherited Test::More from Schwern I was of the opinion that we should not be afraid to break things, and should improve the tools in Test::More directly to be better. The first thing I tried was fixing diagnostics messages thinking "What is the worse that could happen?" The answer: An ungodly amount of downstream modules implement custom test tools that wrap is, ok, is_deeply, etc, through in a This realization, that any changes to Test::More would require cooperation of many authors, some of whom are absent, and would break everything otherwise, is what resulted in Test2, and more importantly Test2::Suite and Test2::V0 existing.
Test::More is now considered "on life support". I will not make breaking changes unless there is no option. Breaking changes include diagnostics changes sadly. Critical bugs, or fixing things that will break because of larger perl changes, etc still happen, but that is about it. We could argue all day about how we should not have gotten here, that people making big string comparisons on TAP is a mistake and they can reap what they sow, I will probably agree with everything someone might say about this... but at the end of the day we are here, we were here when I inherited the project, and I am not going to break cpan for everyone. If you do not want to switch to Test2, that is fine, I am not going to apply any pressure there, so do what works best for you. There are also other cpan libraries I had nothing to do with that implement alternative is_deeply functionalities if anyone decides to boycott Test2 for whatever reason. Sorry in advance if you do not like this answer. |
Sorry if that response is saltier than the question warrents. I have had this discussion a lot lately with people who either do not know about Test2, or do not want to bother looking at it. So I unloaded all the reasoning and results of previous discussions on the matter in hopes that if the discussion here does continue it can hopefully be original content, and not the same discussion I have had countless times. |
In my frequent daily use of Test::More I find is_deeply to be highly relevant, because when things go wrong, it prints out helpful diagnostics. So I use it to compare strings and numbers as well as structures to speed up my diagnosis of failing tests. Indeed I prefer it to the ok series because it prints these diagnostics while ok does not. When comparing strings in this manner it would be helpful if is_deeply could indicate the location of the first mismatch in the printed strings received and expected as it often takes quite a lot of effort to locate this point manually in long strings. In my tests this is often at the end of the string where perhaps the test expects a trailing end of line but the actual result received is missing said new line, or has two too many. Might it be possible to further enhance this excellent function to further speed my test driven development technique which rely so heavily upon is_deeply's capabilities?
The text was updated successfully, but these errors were encountered: