mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
tests: colorize failing tests, improve layout (#8066)
This commit is contained in:
@ -30,7 +30,8 @@ pub fn can_show_color_on_stderr() bool {
|
||||
// If colors are not allowed, returns a given string.
|
||||
pub fn ok_message(s string) string {
|
||||
return if can_show_color_on_stdout() {
|
||||
green(s)
|
||||
msg := ' $s '
|
||||
green(msg)
|
||||
} else {
|
||||
s
|
||||
}
|
||||
@ -40,7 +41,8 @@ pub fn ok_message(s string) string {
|
||||
// If colors are not allowed, returns a given string.
|
||||
pub fn fail_message(s string) string {
|
||||
return if can_show_color_on_stdout() {
|
||||
bold(bg_red(white(s)))
|
||||
msg := ' $s '
|
||||
inverse(bg_white(bold(red(msg))))
|
||||
} else {
|
||||
s
|
||||
}
|
||||
@ -50,7 +52,7 @@ pub fn fail_message(s string) string {
|
||||
// If colors are not allowed, returns a given string.
|
||||
pub fn warn_message(s string) string {
|
||||
return if can_show_color_on_stdout() {
|
||||
bright_yellow(s)
|
||||
bright_yellow(' $s ')
|
||||
} else {
|
||||
s
|
||||
}
|
||||
|
Reference in New Issue
Block a user