diff options
| author | J08nY | 2017-08-30 20:28:33 +0200 |
|---|---|---|
| committer | J08nY | 2017-08-30 20:28:33 +0200 |
| commit | bfeeedd8b158288b1e66e241620966e933c9e3c7 (patch) | |
| tree | d7127e7187a49ad19e1a97664aaf032a8c17cbf6 /test/src/io/test_input.c | |
| parent | 27241c94ef0a1752128c31a62fcfc89b3ee89b33 (diff) | |
| download | ecgen-bfeeedd8b158288b1e66e241620966e933c9e3c7.tar.gz ecgen-bfeeedd8b158288b1e66e241620966e933c9e3c7.tar.zst ecgen-bfeeedd8b158288b1e66e241620966e933c9e3c7.zip | |
Test the random generators.
Diffstat (limited to 'test/src/io/test_input.c')
| -rw-r--r-- | test/src/io/test_input.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/src/io/test_input.c b/test/src/io/test_input.c index 30bbcb1..de4ac0f 100644 --- a/test/src/io/test_input.c +++ b/test/src/io/test_input.c @@ -55,6 +55,12 @@ Test(input, test_prime_nonprime) { cr_assert(gequal(p, gen_m1),); } +Test(input, test_prime_newline) { + fprintf(write_in, "\n"); + GEN p = input_prime(NULL, 10); + cr_assert(gequal(p, gen_m1),); +} + Test(input, test_int) { fprintf(write_in, "256\n"); GEN i = input_int(NULL, 10); @@ -79,3 +85,10 @@ Test(input, test_str) { GEN expected = strtoGENstr("something"); cr_assert(gequal(s, expected),); } + +Test(input, test_str_newline) { + fprintf(write_in, "\n"); + GEN s = input_string(NULL); + GEN expected = strtoGENstr(""); + cr_assert(gequal(s, expected),); +} |
