Exemplo n.º 1
0
 def test_findall_string_concat2(self):
   eq_(eval(begin(findall(concat(x, y, "abc"), L(x, y), z), z)), 
            [L("a", "bc"), L("ab", "c")])
Exemplo n.º 2
0
 def test_sub_string(self):
   eq_(eval(begin(findall(subsequence('ab', 0, y, 2, "ab"), y, z), z)), 
            [2])
Exemplo n.º 3
0
 def test_sub_string2(self):
   eq_(eval(begin(findall(subsequence('ab', x, y, z, k), k, z), z)), 
            ['a', 'ab', 'b'])
Exemplo n.º 4
0
 def testonce(self):
   eq_(eval(findall(once(prin('1, ')|prin('2, ')))), True)
Exemplo n.º 5
0
 def test_findall(self):
   x, y, z = Var('x'), Var('y'), Var('z')
   eq_(eval(let([(f, function(((), 2), ((), 3)))], 
              findall(is_(x, f()), x, y), y)), [2, 3])
Exemplo n.º 6
0
 def test_findall_string_concat2(self):
     eq_(eval(begin(findall(concat(x, y, "abc"), L(x, y), z), z)),
         [L("a", "bc"), L("ab", "c")])
Exemplo n.º 7
0
 def test_sub_string2(self):
     eq_(eval(begin(findall(subsequence('ab', x, y, z, k), k, z), z)),
         ['a', 'ab', 'b'])
Exemplo n.º 8
0
 def test_sub_string(self):
     eq_(eval(begin(findall(subsequence('ab', 0, y, 2, "ab"), y, z), z)),
         [2])
Exemplo n.º 9
0
 def test_findall(self):
     x, y, z = Var('x'), Var('y'), Var('z')
     eq_(
         eval(
             let([(f, function(((), 2), ((), 3)))],
                 findall(is_(x, f()), x, y), y)), [2, 3])
Exemplo n.º 10
0
 def testonce(self):
     eq_(eval(findall(once(prin('1, ') | prin('2, ')))), True)