mirror of https://github.com/mum4k/termdash.git
Licences and fixing data race.
This commit is contained in:
parent
b7fa909466
commit
550afdd613
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue