mirror of
https://github.com/walles/moar.git
synced 2024-11-27 01:05:23 +03:00
18 lines
434 B
Go
18 lines
434 B
Go
|
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'}, "")
|
||
|
}
|