Commit 00241cdd authored by Taddeus Kroes's avatar Taddeus Kroes

Added a basic unit test for strategy (needs to be extended).

parent 5f84e863
from src.rules.factors import match_expand, expand_double, expand_single
from src.node import Scope
from src.possibilities import Possibility as P
from src.strategy import find_possibilities
from tests.rulestestcase import RulesTestCase, tree
class TestStrategy(RulesTestCase):
def test_find_possibilities_sort(self):
(ab, cd), e = root = tree('(a + b)(c + d)e')
self.assertEqualPos(find_possibilities(root),
[P(root, expand_single, (Scope(root), cd, e)),
P(root, expand_single, (Scope(root), ab, e)),
P(root, expand_double, (Scope(root), ab, cd))])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment