summaryrefslogtreecommitdiff
path: root/test/test1.c
blob: 777aa5f4aa7a326cda02fcef541bb93bf2808912 (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
/* 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");
}