-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathkosme.c
31 lines (25 loc) · 944 Bytes
/
kosme.c
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
/* See LICENSE file for copyright and license details. */
#include <utf.h>
#include "tap.h"
#define KOSME "\xCE\xBA\xE1\xBD\xB9\xCF\x83\xCE\xBC\xCE\xB5"
int
main(void)
{
plan(7);
if(is(utflen(KOSME), 5, "\""KOSME"\" is 5 runes long")) {
Rune rbuf[6], *p;
const char *s;
int n;
for(p = rbuf, s = KOSME; (n = chartorune(p, s)), *p != 0; p++, s += n)
;
is(rbuf[0], 0x03BA, "rune 0 of \""KOSME"\" is U+03BA GREEK SMALL LETTER KAPPA");
is(rbuf[1], 0x1F79, "rune 1 of \""KOSME"\" is U+1F79 GREEK SMALL LETTER OMICRON WITH OXIA");
is(rbuf[2], 0x03C3, "rune 2 of \""KOSME"\" is U+03C3 GREEK SMALL LETTER SIGMA");
is(rbuf[3], 0x03BC, "rune 3 of \""KOSME"\" is U+03BC GREEK SMALL LETTER MU");
is(rbuf[4], 0x03B5, "rune 4 of \""KOSME"\" is U+03B5 GREEK SMALL LETTER EPSILON");
is(rbuf[5], 0x0000, "rune 5 of \""KOSME"\" is U+0000 NULL");
}
else
skip(6, "\""KOSME"\" is an unexpected number of runes long");
return 0;
}