Skip to content

stri_rand_strings() should allow length = integer() #524

@DavisVaughan

Description

@DavisVaughan

I've got some fuzzing code that generates random strings like this

n_strings <- sample(0:10000, size = 1)
string_size <- sample(0:100, n_strings, TRUE)
stringi::stri_rand_strings(n_strings, string_size)

Notice how the length of string_size is equal to the number of strings, i.e. n_strings, so that it can be provided to stri_rand_strings().

This fails when we get n_strings = 0:

stringi::stri_rand_strings(0, integer())

I'd argue this should probably be allowed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions