Licences and fixing data race.

This commit is contained in:
Jakub Sobon 2019-02-11 00:14:24 -05:00
parent b7fa909466
commit 550afdd613
No known key found for this signature in database
GPG Key ID: F2451A77FB05D3B7
1 changed files with 5 additions and 5 deletions

View File

@ -4,7 +4,6 @@ import (
"testing"
"github.com/kylelemons/godebug/pretty"
"github.com/mum4k/termdash/eventqueue"
"github.com/mum4k/termdash/terminalapi"
)
@ -17,8 +16,6 @@ func TestNewTerminal(t *testing.T) {
{
desc: "default options",
want: &Terminal{
events: eventqueue.New(),
done: make(chan struct{}),
colorMode: terminalapi.ColorMode256,
},
},
@ -28,8 +25,6 @@ func TestNewTerminal(t *testing.T) {
ColorMode(terminalapi.ColorModeNormal),
},
want: &Terminal{
events: eventqueue.New(),
done: make(chan struct{}),
colorMode: terminalapi.ColorModeNormal,
},
},
@ -38,6 +33,11 @@ func TestNewTerminal(t *testing.T) {
for _, tc := range tests {
t.Run(tc.desc, func(t *testing.T) {
got := newTerminal(tc.opts...)
// Ignore these fields.
got.events = nil
got.done = nil
if diff := pretty.Compare(tc.want, got); diff != "" {
t.Errorf("newTerminal => unexpected diff (-want, +got):\n%s", diff)
}