blob: 967815711b4e2e16919956c2f75576844a9a3580 [file] [log] [blame]
package datok
import (
"bytes"
"testing"
"github.com/stretchr/testify/assert"
)
func TestTokenWriterSimple(t *testing.T) {
assert := assert.New(t)
b := make([]byte, 0, 2048)
w := bytes.NewBuffer(b)
tws := NewTokenWriterSimple(w)
assert.NotNil(tws)
tws.Token(0, []rune{'a', 'b', 'c'})
tws.Token(0, []rune{'d', 'e', 'f'})
tws.SentenceEnd()
tws.Flush()
assert.Equal("abc\ndef\n\n", w.String())
}