diff options
Diffstat (limited to 'libgo/go/strconv/quote_test.go')
-rw-r--r-- | libgo/go/strconv/quote_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libgo/go/strconv/quote_test.go b/libgo/go/strconv/quote_test.go index 3f544c43cd5..61d9bf9a571 100644 --- a/libgo/go/strconv/quote_test.go +++ b/libgo/go/strconv/quote_test.go @@ -7,8 +7,23 @@ package strconv_test import ( . "strconv" "testing" + "unicode" ) +// Verify that our isPrint agrees with unicode.IsPrint +func TestIsPrint(t *testing.T) { + n := 0 + for r := rune(0); r <= unicode.MaxRune; r++ { + if IsPrint(r) != unicode.IsPrint(r) { + t.Errorf("IsPrint(%U)=%t incorrect", r, IsPrint(r)) + n++ + if n > 10 { + return + } + } + } +} + type quoteTest struct { in string out string |