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