From b91356dcc581254a433aacd0446e79ddf962ce22 Mon Sep 17 00:00:00 2001 From: David Moles Date: Tue, 26 Feb 2019 10:28:52 -0800 Subject: [PATCH] Add unicode categories --- cmd/suite.go | 5 ++++- internal/suite/unicode.go | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cmd/suite.go b/cmd/suite.go index 28b1ba7..54abc0b 100644 --- a/cmd/suite.go +++ b/cmd/suite.go @@ -24,6 +24,7 @@ type SuiteFlags struct { CountMax uint64 Unicode bool + UnicodeCategories bool UnicodeScripts bool UnicodeProperties bool UnicodeEmoji bool @@ -51,6 +52,7 @@ const ( Unicode key support tests are further divided into: + - Unicode category support (--unicode-categories) - Unicode script support (--unicode-scripts) - Unicode properties support (--unicode-properties) - Unicode emoji support (--unicode-emoji) @@ -58,7 +60,7 @@ const ( If --unicode is specified, all of these are run. Note that there is considerable overlap between the characters in the - script support and properties support tests. + category support, script support, and properties support tests. ` ) @@ -83,6 +85,7 @@ func init() { cmdFlags.Uint64Var(&f.CountMax, "count-max", CountMaxDefault, "max number of files to create, or -1 for no limit") cmdFlags.BoolVarP(&f.Unicode, "unicode", "u", false, "test Unicode keys") + cmdFlags.BoolVar(&f.UnicodeCategories, "unicode-categories", false, "test Unicode categories") cmdFlags.BoolVar(&f.UnicodeScripts, "unicode-scripts", false, "test Unicode scripts") cmdFlags.BoolVar(&f.UnicodeProperties, "unicode-properties", false, "test Unicode properties") cmdFlags.BoolVar(&f.UnicodeEmoji, "unicode-emoji", false, "test Unicode emoji") diff --git a/internal/suite/unicode.go b/internal/suite/unicode.go index 11362ce..0833fa5 100644 --- a/internal/suite/unicode.go +++ b/internal/suite/unicode.go @@ -15,12 +15,17 @@ const ( func AllUnicodeCases() []Case { var cases []Case + cases = append(cases, UnicodeCategoriesCases()...) cases = append(cases, UnicodePropertiesCases()...) cases = append(cases, UnicodeScriptsCases()...) cases = append(cases, UnicodeEmojiCases()...) return cases } +func UnicodeCategoriesCases() []Case { + return rangeTablesToCases("Unicode categories: ", unicode.Categories) +} + func UnicodePropertiesCases() []Case { return rangeTablesToCases("Unicode properties: ", unicode.Properties) }