Created
January 4, 2021 09:46
-
-
Save yammmt/ccb2950b5503da45e835a2d796e695a8 to your computer and use it in GitHub Desktop.
(Rust) test from another file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[cfg(test)] | |
mod tests; | |
fn main() { | |
println!("Hello, world!"); | |
} | |
fn one_p_one() -> u16 { | |
2 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use super::*; | |
#[test] | |
fn test_opo() { | |
assert_eq!(one_p_one(), 2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment