mmport80
Stream Data Min String Length Filter
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(?)
Marked As Solved
NobbZ
I am just realising, that StreamData.string/2s 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.
Also Liked
NobbZ
Last Post!
mmport80
Moreover, having just started parameter testing and gotten this to work, I just found a bug in a regex - this is great! : )
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #hex
- #security









