X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=libgo%2Fgo%2Fstrconv%2Fquote_test.go;h=e440797162b32e5cfd14b1a1a2f522118dfbacac;hp=9a597700d27a7d69dcbeb61cfcc9e88745e5596b;hb=7da93e24295c8b313ecdcedee0b8bde70b335e61;hpb=f86a7907050666ce7cab2890b353619f83d6c98b diff --git a/libgo/go/strconv/quote_test.go b/libgo/go/strconv/quote_test.go index 9a597700d27..e440797162b 100644 --- a/libgo/go/strconv/quote_test.go +++ b/libgo/go/strconv/quote_test.go @@ -29,6 +29,9 @@ func TestQuote(t *testing.T) { if out := Quote(tt.in); out != tt.out { t.Errorf("Quote(%s) = %s, want %s", tt.in, out, tt.out) } + if out := AppendQuote([]byte("abc"), tt.in); string(out) != "abc"+tt.out { + t.Errorf("AppendQuote(%q, %s) = %s, want %s", "abc", tt.in, out, "abc"+tt.out) + } } } @@ -37,6 +40,9 @@ func TestQuoteToASCII(t *testing.T) { if out := QuoteToASCII(tt.in); out != tt.ascii { t.Errorf("QuoteToASCII(%s) = %s, want %s", tt.in, out, tt.ascii) } + if out := AppendQuoteToASCII([]byte("abc"), tt.in); string(out) != "abc"+tt.ascii { + t.Errorf("AppendQuoteToASCII(%q, %s) = %s, want %s", "abc", tt.in, out, "abc"+tt.ascii) + } } } @@ -63,6 +69,9 @@ func TestQuoteRune(t *testing.T) { if out := QuoteRune(tt.in); out != tt.out { t.Errorf("QuoteRune(%U) = %s, want %s", tt.in, out, tt.out) } + if out := AppendQuoteRune([]byte("abc"), tt.in); string(out) != "abc"+tt.out { + t.Errorf("AppendQuoteRune(%q, %U) = %s, want %s", "abc", tt.in, out, "abc"+tt.out) + } } } @@ -71,6 +80,9 @@ func TestQuoteRuneToASCII(t *testing.T) { if out := QuoteRuneToASCII(tt.in); out != tt.ascii { t.Errorf("QuoteRuneToASCII(%U) = %s, want %s", tt.in, out, tt.ascii) } + if out := AppendQuoteRuneToASCII([]byte("abc"), tt.in); string(out) != "abc"+tt.ascii { + t.Errorf("AppendQuoteRuneToASCII(%q, %U) = %s, want %s", "abc", tt.in, out, "abc"+tt.ascii) + } } }