shithub: scc

ref: bf2b631c10be44df6ca87c9b7e7fb279a9a4d4ec
dir: /tests/libc/execute/0023-strpbrk.c/

View raw version
#include <assert.h>
#include <stdio.h>
#include <string.h>

/*
output:
testing
done
end:
*/

int
main()
{
	char buf[] = "abcdef";

	puts("testing");
	assert(strpbrk(buf, "a") == buf);
	assert(strpbrk(buf, "") == NULL);
	assert(strpbrk("", "a") == NULL);
	assert(strpbrk("", "") == NULL);
	assert(strpbrk(buf, "1234") == NULL);
	assert(strpbrk(buf, "f") == buf + 5);
	assert(strpbrk(buf, "12345a") == buf);
	puts("done");

	return 0;
}