Kaweeda
Streamdata: how to set size for generated data
Hi all, I am running property tests and was wondering how to set the size of the data generated. For example in JS you can do this :
describe("when a & b are arbitrary json objects; patch(a, diff(a,b)) == b", function () {
it("holds for lots of small objects", function () {
jsc.assert(property, { tests: 100, size: 50, quiet: false });
});
Which would be running 100 tests and the data generated would be of size 50. I have this right now:
property "when a & b are arbitrary json objects; patch(a, diff(a,b)) == b" do
check all(
map_a <- map_of(one_of([string(:printable), atom(:alphanumeric)]), term()),
map_b <- map_of(one_of([string(:printable), atom(:alphanumeric)]), term()),
max_runs: 100,
initial_size: 1,
max_generation_size: 50
) do
assert map_b == JsonDiffEx.patch(map_a,JsonDiffEx.diff(map_a, map_b))
Is this working the same way ? If not, what should be done? Thank you in advance, and patience with me.
First Post!
dimitarvp
Not completely sure if that’s what you’re asking but stream_data has a section on generation size here: StreamData — StreamData v1.3.0. It also contains links to two other functions that can help you.
0
Popular in Questions
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set?
Thanks.
New
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
If I have a post route which an argument:
post /my_post_route/:my_param1, MyController.my_post_handler
How would get the post params ...
New
Other popular topics
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
Hi All,
I set a environment variables in dev.exs , like below code.
when i start server, how can i set the ${enable} value?
thanks.
d...
New
What learn first? Rust or Elixir
Hi Elixir community!
I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
After calling mix ecto.create I get this error:
17:00:32.162 [error] GenServer #PID<0.412.0> terminating
** (Postgrex.Error) FATAL...
New
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
- #api
- #forms
- #metaprogramming
- #security
- #hex









