'Test defining and using tgrep2 macros.'

def test_use_macros(self):

    tree = ParentedTree.fromstring(u'(VP    (VB    sold)    (NP    (DET    the)    (NN    heiress))    (NP    (NN    deed)    (PREP    to)    (NP    (DET    the)    (NN    school)    (NN    house))))')
    self.assertEqual(list(tgrep.tgrep_positions(u'@    NP    /^NP/;\n@    NN    /^NN/;\n@NP    !<    @NP    !$..    @NN', [tree])), [[(1,), (2, 2)]])
    self.assertRaises(tgrep.TgrepException, list, tgrep.tgrep_positions(u'@    NP    /^NP/;\n@    NN    /^NN/;\n@CNP    !<    @NP    !$..    @NN', [tree]))
