Commit 0332d46d authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 3b04f1df
......@@ -78,7 +78,6 @@ func Append(b []byte, x Stringer) []byte {
}
// V, similarly to %v, adds x formatted by default rules
// XXX -> V(interface {}) ?
func (b *Buffer) V(x Stringer) *Buffer {
*b = Append(*b, x)
return b
......@@ -96,13 +95,35 @@ func (b *Buffer) Sb(x []byte) *Buffer {
return b
}
// Q appends string formatted by %q
func (b *Buffer) Q(s string) *Buffer {
*b = strconv.AppendQuote(*b, s)
return b
}
// Qb appends []byte formatted by %q
func (b *Buffer) Qb(s []byte) *Buffer {
*b = strconv.AppendQuote(*b, mem.String(s))
return b
}
// Qcb appends byte formatted by %q
func (b *Buffer) Qcb(c byte) *Buffer {
return b.Qc(rune(c))
}
// Qc appends rune formatted by %q
func (b *Buffer) Qc(c rune) *Buffer {
*b = strconv.AppendQuoteRune(*b, c)
return b
}
// Cb appends byte formatted by %c
func (b *Buffer) Cb(c byte) *Buffer {
*b = append(*b, c)
return b
}
// AppendRune appends to b UTF-8 encoding of r
func AppendRune(b []byte, r rune) []byte {
l := len(b)
......@@ -175,26 +196,3 @@ func (b *Buffer) X016(x uint64) *Buffer {
*b = AppendHex016(*b, x)
return b
}
// Q appends string formatted by %q
func (b *Buffer) Q(s string) *Buffer {
*b = strconv.AppendQuote(*b, s)
return b
}
// Qb appends []byte formatted by %q
func (b *Buffer) Qb(s []byte) *Buffer {
*b = strconv.AppendQuote(*b, mem.String(s))
return b
}
// Qcb appends byte formatted by %q
func (b *Buffer) Qcb(c byte) *Buffer {
return b.Qc(rune(c))
}
// Qc appends rune formatted by %q
func (b *Buffer) Qc(c rune) *Buffer {
*b = strconv.AppendQuoteRune(*b, c)
return b
}
......@@ -82,7 +82,6 @@ func TestXFmt(t *testing.T) {
}
xargv := []reflect.Value{reflect.ValueOf(tt.value)}
xretv := []reflect.Value{}
callOk := false
func () {
......
......@@ -48,7 +48,7 @@ var pyQuoteTestv = []struct {in, quoted string} {
// utf-8
// XXX python escapes non-ascii, but since FileStorage connot
// commit such strings we take the freedom and output them as
// readable
// readable.
//{`привет мир`, `'\xd0\xbf\xd1\x80\xd0\xb8\xd0\xb2\xd0\xb5\xd1\x82 \xd0\xbc\xd0\xb8\xd1\x80'`},
{`привет мир`, `'привет мир'`},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment