Files
strans/tests/test_util.c
Hojun-Cho 826da31486 test: drive Korean and Vietnamese through the engine's own transstr
ko_test and vi_test replayed keys with private copies of transstr's
loop, and test_util reimplemented the shown preedit; the engine exports
impre(Im*, Str*) and transstr() instead, so a change to composition
rules is one edit.
2026-08-16 16:25:40 +09:00

23 lines
319 B
C

#include "test.h"
Str
mkstr(char *s)
{
Str r;
sinit(&r, s, strlen(s));
return r;
}
int
checkstr(struct ct *t, char *where, char *want, Str *got)
{
char buf[Maxutf];
stoutf(got, buf, sizeof buf);
if(strcmp(want, buf) == 0)
return 1;
return CT_ERRORF(t, "%s: want \"%s\", got \"%s\"",
where, want, buf);
}