From a61654009f5da7a1b4c52ceae046f59db610af33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20D=C3=A4schle?= Date: Wed, 8 Apr 2020 16:52:40 +0200 Subject: [PATCH] tests: change skip color to yellow instead of red --- vlib/benchmark/benchmark.v | 2 +- vlib/term/term.v | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/vlib/benchmark/benchmark.v b/vlib/benchmark/benchmark.v index 18232d297a..524485b765 100644 --- a/vlib/benchmark/benchmark.v +++ b/vlib/benchmark/benchmark.v @@ -48,7 +48,7 @@ SPENT 462 ms in code_2 const ( BOK = term.ok_message('OK ') BFAIL = term.fail_message('FAIL') - BSKIP = term.fail_message('SKIP') + BSKIP = term.warn_message('SKIP') BSPENT = term.ok_message('SPENT') ) diff --git a/vlib/term/term.v b/vlib/term/term.v index 31b2a1020b..2c8686cd84 100644 --- a/vlib/term/term.v +++ b/vlib/term/term.v @@ -30,6 +30,12 @@ pub fn fail_message(s string) string { return if can_show_color_on_stdout() { red(s) } else { s } } +// warn_message returns a colored string with yellow color. +// If colors are not allowed, returns a given string. +pub fn warn_message(s string) string { + return if can_show_color_on_stdout() { yellow(s) } else { s } +} + // h_divider returns a horizontal divider line with a dynamic width, // that depends on the current terminal settings. // If an empty string is passed in, print enough spaces to make a new line