Skip to content
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: write tests for all library components #60

Open
0x-r4bbit opened this issue Jul 13, 2015 · 1 comment
Open

tests: write tests for all library components #60

0x-r4bbit opened this issue Jul 13, 2015 · 1 comment

Comments

@0x-r4bbit
Copy link
Contributor

Couldn't find any tests in the source yet (if there are any, please point me to them). Is there already a convenient way of writing (unit) tests for Rust libraries?

@kbknapp
Copy link
Member

kbknapp commented Jul 13, 2015

We don't have any yet. But there are several convenient ways to write tests in Rust. We can use cargo integration tests by adding a tests/ directory, unit level testing via a mod tests { } or function level testing with #[test] directive (or a combination of all three). Some good reading on the subject is can be found the relevant section of the book.

It's all relatively easy...just time consuming.

Also as of clap v1.0.0 arguments can be parsed from arbitrary locations (i.e. simulated command line usage), meaning we could even add CLI testing.

@cburgdorf cburgdorf modified the milestone: 1.0 Jul 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants