Skip to content

Commit

Permalink
Generate empty strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
gchallen committed Jul 30, 2021
1 parent 4c8dc89 commit d88ea04
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/kotlin/generators/Type.kt
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ class StringGenerator(random: Random) : TypeGenerators<String>(random) {
companion object {
@Suppress("MemberVisibilityCanBePrivate")
fun random(complexity: Complexity, random: Random = Random): String {
return (1..(complexity.squared() + 1))
return (0 until random.nextInt((complexity.squared() + 1).toInt()))
.map { random.nextInt(CharGenerator.ALPHANUMERIC_CHARS.size) }
.map(CharGenerator.ALPHANUMERIC_CHARS::get)
.joinToString("")
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=2021.7.0
version=2021.7.1

0 comments on commit d88ea04

Please sign in to comment.