summaryrefslogtreecommitdiff
path: root/src/test/test-locale-util.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-04-18 10:53:25 +0200
committerSven Eden <yamakuzure@gmx.net>2018-08-24 16:47:08 +0200
commit58052134ff77e71d9f73eb437ee420b2211c39ac (patch)
tree0af4310c573aad3c6ea8987f175f9aa5adb220ee /src/test/test-locale-util.c
parent46030154635721dd13254eb5bdacfaa4382e45e3 (diff)
test-locale-util: show special glyphs
This is mostly useful as a sanity check.
Diffstat (limited to 'src/test/test-locale-util.c')
-rw-r--r--src/test/test-locale-util.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/test/test-locale-util.c b/src/test/test-locale-util.c
index 01497b16f..5008630e0 100644
--- a/src/test/test-locale-util.c
+++ b/src/test/test-locale-util.c
@@ -26,6 +26,8 @@ static void test_get_locales(void) {
}
static void test_locale_is_valid(void) {
+ log_info("/* %s */", __func__);
+
assert_se(locale_is_valid("en_EN.utf8"));
assert_se(locale_is_valid("fr_FR.utf8"));
assert_se(locale_is_valid("fr_FR@euro"));
@@ -43,6 +45,8 @@ static void test_keymaps(void) {
char **p;
int r;
+ log_info("/* %s */", __func__);
+
assert_se(!keymap_is_valid(""));
assert_se(!keymap_is_valid("/usr/bin/foo"));
assert_se(!keymap_is_valid("\x01gar\x02 bage\x03"));
@@ -65,11 +69,31 @@ static void test_keymaps(void) {
assert_se(keymap_is_valid("unicode"));
}
+#define dump_glyph(x) log_info(STRINGIFY(x) ": %s", special_glyph(x))
+static void dump_special_glyphs(void) {
+ assert_cc(ELLIPSIS + 1 == _SPECIAL_GLYPH_MAX);
+
+ log_info("/* %s */", __func__);
+
+ log_info("is_locale_utf8: %s", yes_no(is_locale_utf8()));
+
+ dump_glyph(TREE_VERTICAL);
+ dump_glyph(TREE_BRANCH);
+ dump_glyph(TREE_RIGHT);
+ dump_glyph(TREE_SPACE);
+ dump_glyph(TRIANGULAR_BULLET);
+ dump_glyph(BLACK_CIRCLE);
+ dump_glyph(ARROW);
+ dump_glyph(MDASH);
+ dump_glyph(ELLIPSIS);
+}
+
int main(int argc, char *argv[]) {
test_get_locales();
test_locale_is_valid();
-
test_keymaps();
+ dump_special_glyphs();
+
return 0;
}