-
Notifications
You must be signed in to change notification settings - Fork 215
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
Bring coverage up to 100% line coverage #55
Comments
I'm learning Go and I thought the best way to do it would be to improve some tests. I brought coverage up a notch from 99.3% to 99.4%, but then I started experimenting with a test for patch.go:546 and I've added this test-case (never mind the expected value, I was going to correct it): Now my test fails like this:
Do you think it's a genuine candidate for code improvement or am I being silly with my test case? |
Yes, I guess it's my test case. The panic is in the test code. |
I did not try it but when I guess that the test panics because "err" is nil so the "Error" call fails because of that. I think it is NEVER silly to improve a project ;-) To be honest, if you are just learning Go it would be more fun to write new code than adding test cases. Finding test cases for this project is especially hard, there aren't many instances left and the easy ones are already gone. |
Maybe #54 is more fun since you would write new code, must test it, and then have to benchmark your solution. The marker is here go-diff/diffmatchpatch/diff.go Line 459 in 431343a
|
I looked through the open issues and I think #49 could be also mildly interesting since the whole project is missing example for every exported API endpoint. #57 and #58 could be also interesting, at least there is new code involved. However, if you are just learning Go I am a little lost on what might be the most interesting and easiest issue for this project. |
Thanks very much for your help, @zimmski! I'll try a few things and see how I get on. |
@maksimov I think with your changes the bar has been raised high enough to close this issue |
There are some lines that still do not have test cases https://coveralls.io/github/sergi/go-diff It would be nice to bring the coverage up to a real 100% and then stay there by making decreasing coverage a PR failure.
The text was updated successfully, but these errors were encountered: