]> git.ipfire.org Git - thirdparty/git.git/commitdiff
test-ctype: check EOF
authorRené Scharfe <l.s.r@web.de>
Mon, 1 May 2023 19:51:57 +0000 (21:51 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 2 May 2023 16:25:54 +0000 (09:25 -0700)
The character classifiers are supposed to allow passing EOF to them, a
negative value.  It isn't part of any character class.  Extend the tests
to cover that.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/helper/test-ctype.c

index b21bd672d9ff63d1cf29a9c7a2ad300f0e58c0c0..c8a0363ba207438422db2c2d286075bbab51ee7b 100644 (file)
@@ -28,6 +28,8 @@ static int is_in(const char *s, int ch)
                if (is_in(s, i) != t(i))        \
                        report_error(#t, i);    \
        }                                       \
+       if (t(EOF))                             \
+               report_error(#t, EOF);          \
 }
 
 #define DIGIT "0123456789"