Commit 8ba37244 authored by Niels Möller's avatar Niels Möller
Browse files

(test_main): New test with tokens

in the format string.

Rev: src/nettle/testsuite/sexp-format-test.c:1.5
parent 889b9bc9
......@@ -73,7 +73,24 @@ test_main(void)
ASSERT(MEMEQ(buffer.size, buffer.contents, e));
/* Try literals */
const uint8_t e[] = "(3:foo(3:bar17:xxxxxxxxxxxxxxxxx))";
ASSERT(sexp_format(&buffer, "(%0s(bar%0s))",
"foo", "xxxxxxxxxxxxxxxxx")
== strlen(e));
ASSERT(sexp_format(NULL, "(%0s(%0s%0s))",
"foo", "bar", "xxxxxxxxxxxxxxxxx")
== strlen(e));
ASSERT(buffer.size == strlen(e));
ASSERT(MEMEQ(buffer.size, buffer.contents, e));
mpz_t x;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment