fe2o3
Conventions
Unit Testing
Unit tests are, as is done in Rust, written directly in the src file. PRs without unit tests are not merged. Example from cargo new:
Unit tests are, as is done in Rust, written directly in the src file. PRs without unit tests are not merged. Example from cargo new:
pub fn add(left: usize, right: usize) -> usize {
left + right
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}