aboutsummaryrefslogtreecommitdiff
path: root/test/test1.c
blob: 586be35029bc02ee1240d9bde20f11da7ede8b44 (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, strrgt("alexander", "xander"));
	asserti(1, strrgt("alexander", "dander"));
	asserti(1, strrgt("alexander", "alex"));
	asserti(0, strrgt("alexander", "alexander"));
	asserti(1, strrgt("dwm",       "dwmdwm"));

	printf("OK\n");
}

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

	printf("OK\n");
}

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