diff options
-rw-r--r-- | src/test/test-fileio.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/test/test-fileio.c b/src/test/test-fileio.c index 3dd4287ff0..2ff5b9a69d 100644 --- a/src/test/test-fileio.c +++ b/src/test/test-fileio.c @@ -759,7 +759,11 @@ static void test_read_line3(void) { assert_se(f); r = read_line(f, LINE_MAX, &line); - assert_se((size_t) r == strlen(line) + 1); + assert_se(r >= 0); + if (r == 0) + assert_se(line && isempty(line)); + else + assert_se((size_t) r == strlen(line) + 1); assert_se(read_line(f, LINE_MAX, NULL) == 0); } |