exercism-solutions/rust/nth-prime/tests/nth-prime.rs

30 lines
473 B
Rust
Raw Permalink Normal View History

2024-11-06 12:39:39 -06:00
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);
}