From 02481656966b0a8dfc95cf3c22bcc049660ff7d4 Mon Sep 17 00:00:00 2001 From: Federico Igne Date: Sat, 26 Dec 2020 17:48:38 +0000 Subject: Move Rust exercises in a subdirectory --- rust/nth-prime/tests/nth-prime.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 rust/nth-prime/tests/nth-prime.rs (limited to 'rust/nth-prime/tests') diff --git a/rust/nth-prime/tests/nth-prime.rs b/rust/nth-prime/tests/nth-prime.rs new file mode 100644 index 0000000..b313ff2 --- /dev/null +++ b/rust/nth-prime/tests/nth-prime.rs @@ -0,0 +1,21 @@ +use nth_prime as np; + +#[test] +fn test_first_prime() { + assert_eq!(np::nth(0), 2); +} + +#[test] +fn test_second_prime() { + assert_eq!(np::nth(1), 3); +} + +#[test] +fn test_sixth_prime() { + assert_eq!(np::nth(5), 13); +} + +#[test] +fn test_big_prime() { + assert_eq!(np::nth(10_000), 104_743); +} -- cgit v1.2.3