Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

allow specifying the charset to use with the RandomString template function #785

Merged

Conversation

laverya
Copy link
Member

@laverya laverya commented Jan 4, 2019

What I Did

Extended the RandomString template function to allow specifying the character set to use

How I Did it

By adding , providedCharset ...string to the function definition and using it if provided

How to verify it

Unit tests have been added to show that the function works without specifying a character set, and that a wide variety of specified character sets work.

Description for the Changelog

The RandomString template function now optionally accepts a character set to use

Picture of a Boat (not required but encouraged)

USS Gridley (DD-380)

@@ -14,3 +19,75 @@ func TestGenerateRandomString(t *testing.T) {
assert.Regexp(t, DefaultCharset, str)

}

func TestGenerateRandomStringTemplates(t *testing.T) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function TestGenerateRandomStringTemplates has 61 lines of code (exceeds 50 allowed). Consider refactoring.

@laverya laverya requested a review from ebramanti January 4, 2019 01:17
@laverya laverya merged commit 83eac8b into replicatedhq:master Jan 4, 2019
@laverya laverya deleted the allow-specifying-randomstring-charsets branch January 4, 2019 01:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants