示例#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")])
示例#2
0
 def test_sub_string(self):
   eq_(eval(begin(findall(subsequence('ab', 0, y, 2, "ab"), y, z), z)), 
            [2])
示例#3
0
 def test_sub_string2(self):
   eq_(eval(begin(findall(subsequence('ab', x, y, z, k), k, z), z)), 
            ['a', 'ab', 'b'])
示例#4
0
 def testonce(self):
   eq_(eval(findall(once(prin('1, ')|prin('2, ')))), True)
示例#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])
示例#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")])
示例#7
0
 def test_sub_string2(self):
     eq_(eval(begin(findall(subsequence('ab', x, y, z, k), k, z), z)),
         ['a', 'ab', 'b'])
示例#8
0
 def test_sub_string(self):
     eq_(eval(begin(findall(subsequence('ab', 0, y, 2, "ab"), y, z), z)),
         [2])
示例#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])
示例#10
0
 def testonce(self):
     eq_(eval(findall(once(prin('1, ') | prin('2, ')))), True)