Closed mgree closed 4 years ago
Thanks for reporting this! This should be an easy one :^)
Confirmed the issue, fixing...
This was fixed in gramfuzz==1.3.2 pip install --upgrade gramfuzz
(or pip3 install --upgrade gramfuzz
) to get the fixes.
(venv)> pip install gramfuzz==1.3.2
...
(venv)> python
Python 3.6.8 (default, Apr 9 2019, 04:59:38)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from gramfuzz.fields import Int
>>> min = 0
>>> max = 65535
>>> g = Int(min=min, max=max)
>>> list(filter(lambda x: x < min and x > max, [g.build() for x in range(100000)]))
[]
Checklist
Environment
Platform
Python Version
Describe the bug
Setting
min
andmax
doesn't seem to affect theInt
field's behavior. TheInt.build()
method only checks to see whethermin
/max
constrain a single value rather than using it has a general set of constraints.To Reproduce
Expected Behavior
I expect no values below
min
or abovemax
to be generated.Current Workaround
I use
UInt
with an explicitodds
setting.