LukeShortCloud / rootpages

Root Pages is a collection of easy-to-reference tutorials and guides primarily for Linux and other UNIX-like systems.
Other
56 stars 6 forks source link

[programming][rust] How to write and use tests #980

Closed LukeShortCloud closed 1 year ago

LukeShortCloud commented 1 year ago
#[cfg(test)]
mod tests {
    #[test]
    fn first_unit_test() {
        // Add unit test code here.
    }
}

https://doc.rust-lang.org/book/ch11-00-testing.html