'Test a simple use of tgrep for finding nodes matching a given
pattern.'

def test_node_simple(self):

    tree = ParentedTree.fromstring(u'(S    (NP    (DT    the)    (JJ    big)    (NN    dog))    (VP    bit)    (NP    (DT    a)    (NN    cat)))')
    self.assertEqual(list(tgrep.tgrep_positions(u'NN', [tree])), [[(0, 2), (2, 1)]])
    self.assertEqual(list(tgrep.tgrep_nodes(u'NN', [tree])), [[tree[(0, 2)], tree[(2, 1)]]])
    self.assertEqual(list(tgrep.tgrep_positions(u'NN|JJ', [tree])), [[(0, 1), (0, 2), (2, 1)]])
