aboutsummaryrefslogtreecommitdiffstats
path: root/test/t_queryparse.py
blob: 3cf5dcb06c9b471d6541b60cdfc813f1926d08c6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/python3
import sys
sys.path.insert(0, "../")
import queryparse

def f(x):
	print(x)
	v,lits = queryparse.parse(x)
	print(v)
	print(lits)
	print()

f(["x", "OR", "y"])
f(["x", "y", "OR", "x", "b"])
f(["x", "y", "z", "w"])
f(["NOT", "x", "OR", "y"])
f(["NOT", "[", "x", "y", "z", "]"])
f(["x", "y", "NOT", "z", "[", "a", "OR", "b", "]", "c"])
f(["x", "y", "z", "OR", "NOT", "x", "a", "z"])
f(["~~internal-*", "~-Application*", "NOT", "~~*xyz*"])
f(["NOT", "[", "x", "y", "z", "OR", "x", "a", "]", "b"])