package nbyte_test import ( "git.noahlan.cn/noahlan/ntool/nbyte" "git.noahlan.cn/noahlan/ntool/ntest/assert" "testing" ) func TestBuffer_WriteAny(t *testing.T) { buf := nbyte.NewBuffer() buf.QuietWritef("ab-%s", "c") buf.QuietWriteByte('d') assert.Eq(t, "ab-cd", buf.ResetAndGet()) buf.QuietWriteString("ab", "-", "cd") buf.MustWriteString("-ef") assert.Eq(t, "ab-cd-ef", buf.ResetAndGet()) buf.WriteAny(23, "abc") assert.Eq(t, "23abc", buf.ResetAndGet()) buf.Writeln("abc") assert.Eq(t, "abc\n", buf.ResetAndGet()) }