From 1fc464f6fbecfc5d8ba9f7b98d19e21fb324bfb9 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 19 Sep 2015 00:45:05 +0200 Subject: cgtop: underline table header Let's underline the header line of the table shown by cgtop, how it is customary for tables. In order to do this, let's introduce new ANSI underline macros, and clean up the existing ones as side effect. --- src/test/test-strip-tab-ansi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/test') diff --git a/src/test/test-strip-tab-ansi.c b/src/test/test-strip-tab-ansi.c index 358454842a..6cec8768b1 100644 --- a/src/test/test-strip-tab-ansi.c +++ b/src/test/test-strip-tab-ansi.c @@ -33,13 +33,13 @@ int main(int argc, char *argv[]) { assert_se(streq(p, " Foobar bar waldo ")); free(p); - assert_se(p = strdup(ANSI_HIGHLIGHT_ON "Hello" ANSI_HIGHLIGHT_OFF ANSI_HIGHLIGHT_RED_ON " world!" ANSI_HIGHLIGHT_OFF)); + assert_se(p = strdup(ANSI_HIGHLIGHT "Hello" ANSI_NORMAL ANSI_HIGHLIGHT_RED " world!" ANSI_NORMAL)); assert_se(strip_tab_ansi(&p, NULL)); fprintf(stdout, "<%s>\n", p); assert_se(streq(p, "Hello world!")); free(p); - assert_se(p = strdup("\x1B[\x1B[\t\x1B[" ANSI_HIGHLIGHT_ON "\x1B[" "Hello" ANSI_HIGHLIGHT_OFF ANSI_HIGHLIGHT_RED_ON " world!" ANSI_HIGHLIGHT_OFF)); + assert_se(p = strdup("\x1B[\x1B[\t\x1B[" ANSI_HIGHLIGHT "\x1B[" "Hello" ANSI_NORMAL ANSI_HIGHLIGHT_RED " world!" ANSI_NORMAL)); assert_se(strip_tab_ansi(&p, NULL)); assert_se(streq(p, "\x1B[\x1B[ \x1B[\x1B[Hello world!")); free(p); -- cgit v1.2.3-54-g00ecf