-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unclear how to ensure x is not in ys #39
Comments
You can use the defmodule NotInTest do
use ExUnit.Case
use ExCheck
def gen_x_yys do
[:triq_dom.int(), list(:triq_dom.int())]
|> bind(fn [x, ys] ->
{x, Enum.filter(ys, fn y -> x != y end)}
end)
end
property :not_in do
for_all {x, ys} in gen_x_yys() do
assert Enum.member?(ys, x) == false
end
end
end A sample of the generator:
|
property :not_in_suchthat do
for_all {x, ys} in such_that({x_, ys_} in {int(), list(int())} when !Enum.member?(ys_, x_)) do
assert Enum.member?(ys, x) == false
end
end |
cool thanks that helps |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a property that takes a string and a list of strings, and part of this property is that the string is not in the list of strings. I can't seem to find a predicate for this, is there some way of accomplishing this in a single property?
Basically what I'm after is something like:
The text was updated successfully, but these errors were encountered: