whitespace regression test from Andy Shevchenko

This commit is contained in:
christos 2008-08-28 16:40:05 +00:00
parent 00c798e9e3
commit 688adf3edf
3 changed files with 27 additions and 2 deletions

View File

@ -1,5 +1,5 @@
# $NetBSD: Makefile,v 1.2 2006/02/28 19:30:45 kleink Exp $
# $NetBSD: Makefile,v 1.3 2008/08/28 16:40:05 christos Exp $
SUBDIR+= printf scanf
SUBDIR+= printf scanf sscanf
.include <bsd.subdir.mk>

View File

@ -0,0 +1,11 @@
# $NetBSD: Makefile,v 1.1 2008/08/28 16:40:05 christos Exp $
NOMAN= # defined
PROG= sscanf
WARNS?= 1
regress: ${PROG}
./${PROG}
.include <bsd.prog.mk>

View File

@ -0,0 +1,14 @@
#include <stdio.h>
#include <err.h>
static const char str[] = "\f\n\r\t\v%z";
int
main(void)
{
/* set of "white space" symbols from isspace(3) */
char c = 0;
(void)sscanf(str, "%%%c", &c);
if (c != 'z')
errx(1, "expected `%c', got `%c'", 'z', c);
return 0;
}