snapshot for sieve

This commit is contained in:
Rorik Star Platinum 2025-12-10 21:44:37 +03:00
parent 418484b415
commit 1432ef7821
7 changed files with 211 additions and 0 deletions

View 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);
}