From 66c99616cea7950a31b138b58e456855597f2d8a Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Fri, 30 Mar 2018 22:24:01 +0200 Subject: [PATCH] enhance completion unit test --- lib/ecoli_complete.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/ecoli_complete.c b/lib/ecoli_complete.c index 815b825..7ad846c 100644 --- a/lib/ecoli_complete.c +++ b/lib/ecoli_complete.c @@ -681,6 +681,18 @@ static int ec_comp_testcase(void) c != NULL && ec_comp_count(c, EC_COMP_ALL) == 2, "complete count should is not 2\n"); + f = open_memstream(&buf, &buflen); + if (f == NULL) + goto fail; + ec_comp_dump(f, NULL); + fclose(f); + f = NULL; + + testres |= EC_TEST_CHECK( + strstr(buf, "no completion"), "bad dump\n"); + free(buf); + buf = NULL; + f = open_memstream(&buf, &buflen); if (f == NULL) goto fail; @@ -688,8 +700,10 @@ static int ec_comp_testcase(void) fclose(f); f = NULL; - /* testres |= EC_TEST_CHECK( */ - /* strstr(buf, "no match"), "bad dump\n"); */ + testres |= EC_TEST_CHECK( + strstr(buf, "comp="), "bad dump\n"); + testres |= EC_TEST_CHECK( + strstr(buf, "comp="), "bad dump\n"); free(buf); buf = NULL; -- 2.20.1