Skip to content
Snippets Groups Projects
Commit 16be5ff6 authored by Niels Möller's avatar Niels Möller
Browse files

(test_main): Added test for %( and

%).

Rev: src/nettle/testsuite/sexp-format-test.c:1.7
parent 3fe07807
No related branches found
No related tags found
No related merge requests found
...@@ -106,6 +106,21 @@ test_main(void) ...@@ -106,6 +106,21 @@ test_main(void)
ASSERT(MEMEQ(buffer.size, buffer.contents, e)); ASSERT(MEMEQ(buffer.size, buffer.contents, e));
} }
/* Literal parenthesis */
{
const uint8_t e[] = ")3:foo(3:bar";
nettle_buffer_init(&buffer);
ASSERT(sexp_format(&buffer, "%)foo%(%s", 3, "bar")
== strlen(e));
ASSERT(sexp_format(NULL, "%)foo%(%s", 3, "bar")
== strlen(e));
ASSERT(buffer.size == strlen(e));
ASSERT(MEMEQ(buffer.size, buffer.contents, e));
}
#if HAVE_LIBGMP #if HAVE_LIBGMP
{ {
mpz_t x; mpz_t x;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment