Log errors in red in summary
This commit is contained in:
19
filesystem_test.go
Normal file
19
filesystem_test.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestSummaryLineMarksFailuresInRed(t *testing.T) {
|
||||
fs := NewRealFileSystem()
|
||||
|
||||
fs.RecordLinkAttempt(opSymlink, "/tmp/source", "/tmp/target", fmt.Errorf("boom"), false)
|
||||
|
||||
lines := fs.SummaryLines()
|
||||
assert.Equal(t, 1, len(lines))
|
||||
assert.Contains(t, lines[0], BRed+"FAIL"+Reset)
|
||||
assert.Contains(t, lines[0], "boom")
|
||||
}
|
||||
Reference in New Issue
Block a user