git.droids-corp.org
/
protos
/
libecoli.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a996bfd
)
enhance completion unit test
author
Olivier Matz
<zer0@droids-corp.org>
Fri, 30 Mar 2018 20:24:01 +0000
(22:24 +0200)
committer
Olivier Matz
<zer0@droids-corp.org>
Fri, 30 Mar 2018 20:24:01 +0000
(22:24 +0200)
lib/ecoli_complete.c
patch
|
blob
|
history
diff --git
a/lib/ecoli_complete.c
b/lib/ecoli_complete.c
index
815b825
..
7ad846c
100644
(file)
--- 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");
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;
f = open_memstream(&buf, &buflen);
if (f == NULL)
goto fail;
@@
-688,8
+700,10
@@
static int ec_comp_testcase(void)
fclose(f);
f = NULL;
fclose(f);
f = NULL;
- /* testres |= EC_TEST_CHECK( */
- /* strstr(buf, "no match"), "bad dump\n"); */
+ testres |= EC_TEST_CHECK(
+ strstr(buf, "comp=<xx>"), "bad dump\n");
+ testres |= EC_TEST_CHECK(
+ strstr(buf, "comp=<yy>"), "bad dump\n");
free(buf);
buf = NULL;
free(buf);
buf = NULL;