Skip to content

Commit c707277

Browse files
committed
further simplified and cleaned up tests
Signed-off-by: Matt Butcher <[email protected]>
1 parent 869801f commit c707277

4 files changed

+1
-13
lines changed

cryptorandomstringutils.go

-4
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,6 @@ Returns:
9898
error - an error stemming from an invalid parameter within underlying function, CryptoRandom(...)
9999
*/
100100
func CryptoRandomAlphaNumeric(count int) (string, error) {
101-
if count == 0 {
102-
return "", nil
103-
}
104-
105101
return CryptoRandom(count, 0, 0, true, true)
106102
}
107103

cryptorandomstringutils_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ func TestCryptoRandAlphaNumeric_FuzzOnlyNumeric(t *testing.T) {
8888
charlen++
8989
for i := 0; i < iters; i++ {
9090
out, err := CryptoRandomAlphaNumeric(charlen)
91-
println(out)
9291
if err != nil {
9392
t.Fatal("func failed to produce a random thinger")
9493
}

randomstringutils.go

+1-7
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,7 @@ Returns:
9999
error - an error stemming from an invalid parameter within underlying function, RandomSeed(...)
100100
*/
101101
func RandomAlphaNumeric(count int) (string, error) {
102-
RandomString, err := Random(count, 0, 0, true, true)
103-
if err != nil {
104-
return "", fmt.Errorf("Error: %s", err)
105-
}
106-
107-
return RandomString[:count], nil
108-
102+
return Random(count, 0, 0, true, true)
109103
}
110104

111105
/*

randomstringutils_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ func TestRandAlphaNumeric_FuzzOnlyNumeric(t *testing.T) {
9090
charlen++
9191
for i := 0; i < iters; i++ {
9292
out, err := RandomAlphaNumeric(charlen)
93-
println(out)
9493
if err != nil {
9594
t.Fatal("func failed to produce a random thinger")
9695
}

0 commit comments

Comments
 (0)