1
1
mirror of https://github.com/walles/moar.git synced 2024-11-27 01:05:23 +03:00
moar/twin/screen_test.go

18 lines
434 B
Go
Raw Normal View History

package twin
import (
"testing"
"gotest.tools/v3/assert"
)
func assertEncode(t *testing.T, incomingString string, expectedEvent Event, expectedRemainder string) {
actualEvent, actualRemainder := consumeEncodedEvent(incomingString)
assert.Equal(t, *actualEvent, expectedEvent)
assert.Equal(t, actualRemainder, expectedRemainder)
}
func TestConsumeEncodedEvent(t *testing.T) {
assertEncode(t, "a", EventRune{rune: 'a'}, "")
}