snapshot for sieve
This commit is contained in:
parent
418484b415
commit
1432ef7821
7 changed files with 211 additions and 0 deletions
29
rust/nth-prime/tests/nth_prime.rs
Normal file
29
rust/nth-prime/tests/nth_prime.rs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
use nth_prime::*;
|
||||
|
||||
#[test]
|
||||
fn first_prime() {
|
||||
let output = nth(0);
|
||||
let expected = 2;
|
||||
assert_eq!(output, expected);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn second_prime() {
|
||||
let output = nth(1);
|
||||
let expected = 3;
|
||||
assert_eq!(output, expected);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn sixth_prime() {
|
||||
let output = nth(5);
|
||||
let expected = 13;
|
||||
assert_eq!(output, expected);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn big_prime() {
|
||||
let output = nth(10_000);
|
||||
let expected = 104_743;
|
||||
assert_eq!(output, expected);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue