cases: skip tests if unicode.Version does not match UnicodeVersion
For golang/go#11811.
Fixes golang/go#11927.
Change-Id: Ie60c687ba93aaeb6c164413289f474be63e0224f
Reviewed-on: https://go-review.googlesource.com/13252
Reviewed-by: Robert Griesemer <gri@golang.org>
diff --git a/cases/context_test.go b/cases/context_test.go
index d6c012f..2b94972 100644
--- a/cases/context_test.go
+++ b/cases/context_test.go
@@ -63,6 +63,9 @@
}
func TestCaseProperties(t *testing.T) {
+ if unicode.Version != UnicodeVersion {
+ t.Skipf("UnicodeVersion=%s, but unicode.Version=%s", UnicodeVersion, unicode.Version)
+ }
assigned := rangetable.Assigned(UnicodeVersion)
for r := rune(0); r <= lastRuneForTesting; r++ {
if !unicode.In(r, assigned) || !unicode.In(unicode.SimpleFold(r), assigned) {
@@ -89,6 +92,9 @@
}
func TestMapping(t *testing.T) {
+ if unicode.Version != UnicodeVersion {
+ t.Skipf("UnicodeVersion=%s, but unicode.Version=%s", UnicodeVersion, unicode.Version)
+ }
assigned := rangetable.Assigned(UnicodeVersion)
apply := func(r rune, f func(c *context) bool) string {
c := contextFromRune(r)