diff options
author | Steven G. Johnson <stevenj@mit.edu> | 2015-03-06 17:36:08 -0500 |
---|---|---|
committer | Steven G. Johnson <stevenj@mit.edu> | 2015-03-06 17:36:08 -0500 |
commit | 90721f2d39b0cdd5d22409f1bf4f6ce4b7382944 (patch) | |
tree | 2b3ec29840c95bc551d86d40902120db5eb1da12 /test/printproperty.c | |
parent | 10f7e2ed5a7f3d05cbbc45f457be12456e6969d3 (diff) | |
download | libutf8proc-90721f2d39b0cdd5d22409f1bf4f6ce4b7382944.tar.gz libutf8proc-90721f2d39b0cdd5d22409f1bf4f6ce4b7382944.tar.bz2 |
directory cleanup: move tests and data into subdirectories
Diffstat (limited to 'test/printproperty.c')
-rw-r--r-- | test/printproperty.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/test/printproperty.c b/test/printproperty.c new file mode 100644 index 0000000..37e4fa3 --- /dev/null +++ b/test/printproperty.c @@ -0,0 +1,45 @@ +/* simple test program to print out the utf8proc properties for a codepoint */ + +#include "tests.h" + +int main(int argc, char **argv) +{ + int i; + + for (i = 1; i < argc; ++i) { + int c; + check(sscanf(argv[i],"%x",&c) == 1, "invalid hex input %s", argv[i]); + const utf8proc_property_t *p = utf8proc_get_property(c); + printf("U+%s:\n" + " category = %d\n" + " combining_class = %d\n" + " bidi_class = %d\n" + " decomp_type = %d\n" + " uppercase_mapping = %x\n" + " lowercase_mapping = %x\n" + " titlecase_mapping = %x\n" + " comb1st_index = %d\n" + " comb2nd_index = %d\n" + " bidi_mirrored = %d\n" + " comp_exclusion = %d\n" + " ignorable = %d\n" + " control_boundary = %d\n" + " boundclass = %d\n", + argv[i], + p->category, + p->combining_class, + p->bidi_class, + p->decomp_type, + p->uppercase_mapping, + p->lowercase_mapping, + p->titlecase_mapping, + p->comb1st_index, + p->comb2nd_index, + p->bidi_mirrored, + p->comp_exclusion, + p->ignorable, + p->control_boundary, + p->boundclass); + } + return 0; +} |