MoreStreamData
Additional generators based on StreamData.
Installation
Add more_stream_data to your list of dependencies in mix.exs
def deps do
[
{:more_stream_data, "~> 0.1", only: :test}
]
endRefer to StreamData documentation for usage.
You can call additional generators directly in any testfile
defmodule MyTestMoule do
use ExUnit.Case
use ExUnitProperties
property "generates numbers greater than or equal to the minimum" do
check all number <- MoreStreamData.more_integer(min: 10) do
assert number >= 10
end
end
endRoadmap
The goal is to port Python's Hypothesis built-in and external strategies considered useful for Elixir ecosystem.
-
Strategies
integersfloatsexclude_minandexclude_maxoptions.
decimalfrom_regex: A bit slow but works\bword boundary\vvertica line meta character-
Non-printable characters (automatically supported with
\x) xHHfor hex charactersx{HHH...}for hex characters- Atomic groups
-
Lookarounds
- Positive lookahead
- Negative lookahead
- Positive lookbehind
- Negative lookbehind
-
Modifiers
-
Case insensitive
/i -
Extended
/x -
Unicode
/u -
Dotall
/s -
Multiline
/m -
Firstline
/f -
Ungreedy
/U. Not actually supported but redundant for string generation.
-
Case insensitive
emailsdomainsurlsdatetimetimetimedeltasip_address