Last active
May 23, 2020 22:29
-
-
Save mentix02/6f0f366f3b881d42756ca31514702242 to your computer and use it in GitHub Desktop.
A test file for primelib.cpp
This file contains hidden or 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
#include "shipyard.hpp" | |
#include "primelib.cpp" | |
void test_is_prime() | |
{ | |
sy::AssertTrue(is_prime(5), "is_prime(5) == true"); | |
sy::AssertFalse(is_prime(12), "is_prime(12) == false"); | |
} | |
void test_n_prime() | |
{ | |
sy::Assert(n_prime(10), uint32_t(29)); | |
sy::Assert(n_prime(100), uint32_t(541)); | |
} | |
void test_primes_till() | |
{ | |
const auto primes = primes_till(10); | |
sy::Assert(primes, {2, 3, 5, 7, 11, 13, 17, 19, 23, 29}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment