Comments (4)
Also, I think that the better solution to test each function/feature is to add unit testing in the documentation of the function, and in a custom file in tests/
.
from snatch.
The directory tests/
has been created by @Jean-Serge - merged with commit 74ff12e
from snatch.
The current solution to test private functions/methods is to add the test module inside the source file that contains those private ones.
Example:
// src/my_mod.rs
/// A private function that returns an Option type
fn my_private_function() -> Option<usize> {
...
}
#[cfg(test)]
mod my_private_tests {
use super::my_private_function;
/// A function to test my_private_function()
fn test_my_private_function() {
...
}
}
However, a good practice is to test public functions/methods in a single test unit file, in the tests/
directory.
from snatch.
Resulting in putting unit tests into the module source file and integration tests into the tests directory.
That way, users could find easily how to use Snatch as a library.
from snatch.
Related Issues (20)
- Filename detection HOT 1
- Better CLI HOT 1
- What is the optimal thread count for a 64 bit Macbook Pro? HOT 2
- Can't compile snatch's pbr dependency with rustc 1.11 HOT 5
- Error installing on OSX HOT 3
- Add a continuous integration service HOT 1
- Downloading files from dropbox doesn't work HOT 1
- Installation documentation needs to be updated HOT 2
- Test does not work HOT 1
- Downloading a resource projected by Basic Authorization panics
- Show net down speed HOT 4
- Alternate progress indicator like axel HOT 1
- incorrect file size in cli HOT 2
- Publish to crates.io HOT 2
- Handle too long of file names. HOT 1
- program get blocked forever when any chunk-downloading thread panics HOT 1
- Cannot download certain files HOT 19
- Use Indicatif HOT 2
- hyper 0.11? HOT 6
- BitTorrent support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snatch.