-
Notifications
You must be signed in to change notification settings - Fork 21
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
Tests #10
Tests #10
Conversation
@BurntSushi: I refactored some code to make it more testable, but didn't do the most minimal change because I saw room for improvement. The changes are in a2caf90. |
The last two test can be implemented once uutils/coreutils#959 is resolved, which should provide a nice crate for integration testing of command line tools. |
Looks like the appveyor build is failing because of rust-lang/rust#35991. |
@BurntSushi: Ready for review/merge |
@BurntSushi Still waiting on a review... |
@@ -15,6 +15,11 @@ license = "Unlicense/MIT" | |||
[dependencies] | |||
docopt = "0.6.81" | |||
lazy_static = "0.2.1" | |||
prettytable-rs = "0.6.2" | |||
quickcheck = "0.3.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both quickcheck
and second_law
should be dev-dependencies
, which means they'll only be required during tests.
@Apanatshka Overall this looks really good. Could you say whether there are any behavior changes here? Sorry about neglecting your PRs. I've been really into another project, and any leftover time I had after that has gone into wedding planning! |
In reverse order:
That doesn't surprise me at all, you seem to be quite the collector :P
If that's not a legitimate "real life" excuse, I don't know what is :) Good luck with that, and remember to enjoy it rather than stressing out ^^
I don't mind nagging until you respond if you don't ;)
Only one outside observable change that I'm aware of: Newlines in the output are now consistently unix |
All right great! Since I merged your other color PR, this one now has a conflict. After a rebase I'll merge. :-) |
While doing so, removed reading whole files/stdin in favour of buffered reading.
Now using windows line endings in expected output when on the windows platform.
Counter-example found in https://ci.appveyor.com/project/BurntSushi/cargo-benchcmp/build/1.0.23/job/fm2b0kwg993qeuuh The from_original property should cover the same functionality anyway, so this doesn't weaken the test suite.
Hah, the test for the usage string just failed, because the Question: Is this even a good test? I basically duplicated the string in the code to a file and test that that's the output on |
@Apanatshka Oh, wow, I see. I missed that. I'd throw away that test. It's better to just write new tests for each new flag/option added. I think having to update a separate file every time the usage string changes is probably too annoying. |
Accidentally left over from old workaround that was supposed to be completely removed in 3cb31d6
Ok then. The usage string test is removed now.
Yeah, ideally I'd like to add integration tests for the coloured output.. But the planned "quickly rebase so it can be merged today" is already taking more time that I expected. I should really get back to work now ^^' In 6 hours I'll have time to capture the output with terminal colour codes in a fixture for a test. |
@Apanatshka This is great, thank you! (Tests for coloring are strictly nice to have. Don't sweat it. :-)) |
Writing tests as described in #3.
Going straight for the bonus points: so far I've written quickcheck tests for a number of unit test situations.
TODO list
Unit tests
names
method off of theArgs
struct.)commafy
.Integration tests