I am trying to generate strings which pass a rule, e.g.
1 < length(string) < 10
So I am using,
StreamData.string( … ) |> StreamData.filter(..)
but, for some reason, I see the data sent thru the filter is always a single character.
The filter filters out everything…
Of course, without the filter, I rarely see single character outputs.
Obviously I am missing something.
The filter in this case is for individual generated characters, instead of complete strings(?)
NobbZ
July 11, 2018, 11:36am
2
Can you please provide a full example of the “generator” you use and its output?
2 Likes
NobbZ
July 11, 2018, 11:46am
3
I am just realising, that StreamData.string/2
s documentation tells you that it shares options with StreamData.list_of/2
. There we have :min_length
and :max_length
options. So StreamData.string(:ascii, min_length: 2, max_length: 9)
should be totally fine.
2 Likes
Sweet, just the answer I needed : )
Moreover, having just started parameter testing and gotten this to work, I just found a bug in a regex - this is great! : )