summaryrefslogtreecommitdiff
path: root/test/test1.c
blob: 3f52c93fb601281564c11bf59bf34f925d157eb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* See LICENSE file for copyright and license details. */

#include <string2.h>
#include <stdio.h>

#include "test.h"

void
test1(void)
{
	printf("executing test1... ");
	asserti(0, strends("alexander", "xander"));
	asserti(1, strends("alexander", "dander"));
	asserti(1, strends("alexander", "alex"));
	asserti(0, strends("alexander", "alexander"));
	asserti(1, strends("dwm",       "dwmdwm"));

	printf("OK\n");
}

void
test2(void)
{
	printf("executing test2... ");
	asserti(0, strstarts("alexander", "alex"));
	asserti(1, strstarts("alexander", "dalex"));
	asserti(1, strstarts("alexander", "xander"));
	asserti(0, strstarts("alexander", "alexander"));
	asserti(1, strstarts("dwm",       "dwmdwm"));

	printf("OK\n");
}

void
test3()
{
	printf("executing %s... OK\n", __func__);
	printf("%s\n", strlibver());
}