mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
27 lines
413 B
Go
27 lines
413 B
Go
|
package logger
|
||
|
|
||
|
import (
|
||
|
"reflect"
|
||
|
"testing"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
func TestCopyMessage(t *testing.T) {
|
||
|
msg := &Message{
|
||
|
Line: []byte("test line."),
|
||
|
Source: "stdout",
|
||
|
Timestamp: time.Now(),
|
||
|
Attrs: LogAttributes{
|
||
|
"key1": "val1",
|
||
|
"key2": "val2",
|
||
|
"key3": "val3",
|
||
|
},
|
||
|
Partial: true,
|
||
|
}
|
||
|
|
||
|
m := CopyMessage(msg)
|
||
|
if !reflect.DeepEqual(m, msg) {
|
||
|
t.Fatalf("CopyMessage failed to copy message")
|
||
|
}
|
||
|
}
|