From bb9e0e4f6e638d40489bc2616dfcaa5398942040 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Sat, 24 Oct 2020 14:03:31 +0200 Subject: [PATCH] Adding test for M_LET for bounded string --- tests/test-mstring.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/test-mstring.c b/tests/test-mstring.c index 56889320..1d2dd4f1 100644 --- a/tests/test-mstring.c +++ b/tests/test-mstring.c @@ -574,6 +574,22 @@ static void test_bounded_io(void) string16_clear(d); } +static void test_bounded_M_LET(void) +{ + M_LET( x, BOUNDED_STRING_OPLIST(string16)) { + assert (string16_empty_p(x)); + } + + M_LET( (x,"tree"), BOUNDED_STRING_OPLIST(string16)) { + assert (string16_equal_str_p(x, "tree")); + } + + M_LET( (x,"tree%d", 78), BOUNDED_STRING_OPLIST(string16)) { + assert (string16_equal_str_p(x, "tree78")); + } + +} + static void test_M_LET(void) { M_LET(s, string_t) { @@ -619,5 +635,6 @@ int main(void) test_utf8_it(); test_bounded1(); test_bounded_io(); + test_bounded_M_LET(); exit(0); }