1
0
mirror of https://github.com/rancher/os.git synced 2025-08-19 23:36:54 +00:00
os/vendor/github.com/docker/machine/log/log_test.go
2015-12-04 20:19:31 +05:00

20 lines
529 B
Go

package log
import "testing"
func TestTerminalLoggerWithFields(t *testing.T) {
logger := TerminalLogger{}
withFieldsLogger := logger.WithFields(Fields{
"foo": "bar",
"spam": "eggs",
})
withFieldsTerminalLogger, ok := withFieldsLogger.(TerminalLogger)
if !ok {
t.Fatal("Type assertion to TerminalLogger failed")
}
expectedOutFields := "\t\t foo=bar spam=eggs"
if withFieldsTerminalLogger.fieldOut != expectedOutFields {
t.Fatalf("Expected %q, got %q", expectedOutFields, withFieldsTerminalLogger.fieldOut)
}
}