def test_contains(): with pf.Graph() as graph: test = pf.placeholder() alphabet = pf.constant('abc') contains = pf.contains(alphabet, test) assert graph(contains, {test: 'a'}) assert not graph(contains, {test: 'x'})
def test_contains(): with pf.Graph() as graph: test = pf.placeholder() alphabet = pf.constant('abc') contains = pf.contains(alphabet, test) assert graph(contains, {test: 'a'}) assert not graph(contains, {test: 'x'}) # ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ # @slipform() def graph(test): alphabet = 'abc' contains = test in alphabet assert graph('contains', {'test': 'a'}) assert not graph('contains', {'test': 'x'})