mmport80

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

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

NobbZ

Can you please provide a full example of the “generator” you use and its output?

Last Post!

mmport80

mmport80

Moreover, having just started parameter testing and gotten this to work, I just found a bug in a regex - this is great! : )

Where Next?

Popular in Questions Top

baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New

Other popular topics Top

JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 54996 245
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

We're in Beta

About us Mission Statement