Beispiel #1
0
    def test_match_twin_elements_bound_end(self):
        s = Section(['test', "a*"])
        s.bound_end = True
        path = []
        matches = [index for index in s.match_iter(path, 0)]
        assert [] == matches

        path = "test".split("/")
        matches = [index for index in s.match_iter(path, 0)]
        assert [] == matches

        path = "test/bin".split("/")
        matches = [index for index in s.match_iter(path, 0)]
        assert [] == matches

        path = "test/andrew".split("/")
        matches = [index for index in s.match_iter(path, 0)]
        assert [2] == matches

        path = "test/andrew/bin/test/ast/test/another".split("/")
        matches = [index for index in s.match_iter(path, 0)]
        assert [7] == matches

        path = "not/util/bin/test/ast/not".split("/")
        matches = [index for index in s.match_iter(path, 0)]
        assert [] == matches
Beispiel #2
0
    def test_match_single_bound_end(self):
        s = Section(['test'])
        s.bound_end = True
        path = []
        matches = [index for index in s.match_iter(path, 0)]
        assert [] == matches

        path = "test".split("/")
        matches = [index for index in s.match_iter(path, 0)]
        assert [1] == matches

        path = "not".split("/")
        matches = [index for index in s.match_iter(path, 0)]
        assert [] == matches

        path = "test/util/bin/test/last/test".split("/")
        matches = [index for index in s.match_iter(path, 0)]
        assert [6] == matches

        path = "not/util/bin/test/last/not".split("/")
        matches = [index for index in s.match_iter(path, 0)]
        assert [] == matches