summaryrefslogtreecommitdiff
path: root/tests/core/test_12.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/core/test_12.c')
-rw-r--r--tests/core/test_12.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/core/test_12.c b/tests/core/test_12.c
index 17d26a6dae54..f6021e749885 100644
--- a/tests/core/test_12.c
+++ b/tests/core/test_12.c
@@ -22,6 +22,7 @@ main (int argc, char **argv)
int i, count = 10;
int mon = 0;
xo_emit_flags_t flags = XOEF_RETAIN;
+ int opt_color = 1;
argc = xo_parse_args(argc, argv);
if (argc < 0)
@@ -36,6 +37,8 @@ main (int argc, char **argv)
xo_set_style(NULL, XO_STYLE_TEXT);
else if (strcmp(argv[argc], "html") == 0)
xo_set_style(NULL, XO_STYLE_HTML);
+ else if (strcmp(argv[argc], "no-color") == 0)
+ opt_color = 0;
else if (strcmp(argv[argc], "pretty") == 0)
xo_set_flags(NULL, XOF_PRETTY);
else if (strcmp(argv[argc], "xpath") == 0)
@@ -51,11 +54,19 @@ main (int argc, char **argv)
}
xo_set_flags(NULL, XOF_UNITS); /* Always test w/ this */
+ if (opt_color)
+ xo_set_flags(NULL, XOF_COLOR); /* Force color output */
xo_set_file(stdout);
xo_open_container("top");
xo_open_container("data");
+ xo_emit("{C:fg-red,bg-green}Merry XMas!!{C:}\n");
+
+ xo_emit("One {C:fg-yellow,bg-blue}{:animal}{C:}, "
+ "Two {C:fg-green,bg-yellow}{:animal}{C:}\n",
+ "fish", "fish");
+
const char *fmt1 = "The {C:fg-red}{k:name}{C:reset} is "
"{C:/fg-%s}{:color}{C:reset} til {:time/%02d:%02d}\n";
const char *fmt2 = "My {C:fg-red}{:hand}{C:reset} hand is "