You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ntool/ntest/buffer_test.go

21 lines
397 B
Go

package ntest_test
import (
"git.noahlan.cn/noahlan/ntool/ntest"
"git.noahlan.cn/noahlan/ntool/ntest/assert"
"testing"
)
func TestNewBuffer(t *testing.T) {
buf := ntest.NewBuffer()
buf.WriteString("ab", "-", "cd")
assert.Eq(t, "ab-cd", buf.ResetAndGet())
buf.WriteAny(23, "abc")
assert.Eq(t, "23abc", buf.ResetAndGet())
buf.Writeln("abc")
assert.Eq(t, "abc\n", buf.ResetAndGet())
}