Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renamed variables to reflect test results #23

Merged
merged 2 commits into from
Jun 7, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
)

var (
success = color.New(color.FgGreen)
skipped = color.New(color.FgYellow)
fail = color.New(color.FgHiRed)
pass = color.New(color.FgGreen)
skip = color.New(color.FgYellow)
fail = color.New(color.FgHiRed)
)

const paletteEnv = "GOTEST_PALETTE"
Expand Down Expand Up @@ -86,19 +86,19 @@ func parse(line string) {
case strings.HasPrefix(trimmed, "?"):
c = nil

// success
// passed
case strings.HasPrefix(trimmed, "--- PASS"):
fallthrough
case strings.HasPrefix(trimmed, "ok"):
fallthrough
case strings.HasPrefix(trimmed, "PASS"):
c = success
c = pass

// skipped
case strings.HasPrefix(trimmed, "--- SKIP"):
c = skipped
c = skip

// failure
// failed
case strings.HasPrefix(trimmed, "--- FAIL"):
fallthrough
case strings.HasPrefix(trimmed, "FAIL"):
Expand Down Expand Up @@ -139,7 +139,7 @@ func setPalette() {
fail = color.New(c)
}
if c, ok := colors[vals[1]]; ok {
success = color.New(c)
pass = color.New(c)
}
}

Expand Down