Skip to content

Commit

Permalink
feat: Add Vowels & NoVowels to the AlphaUpper charsets (#749)
Browse files Browse the repository at this point in the history
  • Loading branch information
supercairos authored Nov 29, 2023
1 parent 022d9bd commit 5616e97
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions randx/sequence.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ var (
AlphaUpperNum = []rune("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
// AlphaLower contains runes [abcdefghijklmnopqrstuvwxyz].
AlphaLower = []rune("abcdefghijklmnopqrstuvwxyz")
// AlphaUpperVowels contains runes [AEIOUY].
AlphaUpperVowels = []rune("AEIOUY")
// AlphaUpperNoVowels contains runes [BCDFGHJKLMNPQRSTVWXZ].
AlphaUpperNoVowels = []rune("BCDFGHJKLMNPQRSTVWXZ")
// AlphaUpper contains runes [ABCDEFGHIJKLMNOPQRSTUVWXYZ].
AlphaUpper = []rune("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
// Numeric contains runes [0123456789].
Expand Down
4 changes: 4 additions & 0 deletions randx/sequence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ func TestRunePatterns(t *testing.T) {
{Alpha, "[a-zA-Z]{52}"},
{AlphaLower, "[a-z]{26}"},
{AlphaUpper, "[A-Z]{26}"},
{AlphaUpperVowels, "[AEIOUY]{6}"},
{AlphaUpperNoVowels, "[^AEIOUY]{20}"},
{AlphaNum, "[a-zA-Z0-9]{62}"},
{AlphaLowerNum, "[a-z0-9]{36}"},
{AlphaUpperNum, "[A-Z0-9]{36}"},
Expand All @@ -38,6 +40,8 @@ func TestRuneSequenceMatchesPattern(t *testing.T) {
{Alpha, "[a-zA-Z]+", 25},
{AlphaLower, "[a-z]+", 46},
{AlphaUpper, "[A-Z]+", 21},
{AlphaUpperVowels, "[AEIOUY]+", 12},
{AlphaUpperNoVowels, "[^AEIOUY]+", 42},
{AlphaNum, "[a-zA-Z0-9]+", 123},
{AlphaLowerNum, "[a-z0-9]+", 41},
{AlphaUpperNum, "[A-Z0-9]+", 94914},
Expand Down

0 comments on commit 5616e97

Please sign in to comment.