"""
Basic tests of the library.
"""

#!/usr/bin/python3
import sys
sys.path.append('build')
import proto_suff  # noqa

explainer = proto_suff.MinimumMajoritaryExplainer()

# get the forest.
with open(sys.argv[1]) as reader:
    # Further file processing goes here
    for line in reader.readlines():
        tree = []
        for s in line.split():
            tree.append(int(s))
        explainer.addTree(tree)


# get the query.
with open(sys.argv[2]) as reader:
    # Further file processing goes here
    for line in reader.readlines():
        x = []
        for e in line.split():
            x.append(int(e))

        res = explainer.explain(x)
        print(len(res))

