'Test that comments are correctly filtered out of tgrep search
strings.'

def test_comments(self):

    tree = ParentedTree.fromstring(u'(S    (NN    x)    (NP    x)    (NN    x))')
    search1 = u'\n                                @    NP    /^NP/;\n                                @    NN    /^NN/;\n                                @NN\n                                '
    self.assertEqual(list(tgrep.tgrep_positions(search1, [tree])), [[(0,), (2,)]])
    search2 = u'\n                                #    macros\n                                @    NP    /^NP/;\n                                @    NN    /^NN/;\n\n                                #    search    string\n                                @NN\n                                '
    self.assertEqual(list(tgrep.tgrep_positions(search2, [tree])), [[(0,), (2,)]])
