brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · a991c5f Raw
52 lines · python
1import lldb2from lldbsuite.test.decorators import *3from lldbsuite.test.lldbtest import *4from lldbsuite.test import lldbutil5 6 7class TestCase(TestBase):8    @no_debug_info_test9    def test_error(self):10        self.expect(11            "breakpoint set --func-regex (",12            error=True,13            substrs=[14                "error: Function name regular expression could "15                + "not be compiled: parentheses not balanced"16            ],17        )18 19        # Point out if looks like the user provided a globbing expression.20        self.expect(21            "breakpoint set --func-regex *a",22            error=True,23            substrs=[24                "error: Function name regular expression could "25                + "not be compiled: repetition-operator operand invalid",26                "warning: Function name regex does not accept glob patterns.",27            ],28        )29        self.expect(30            "breakpoint set --func-regex ?a",31            error=True,32            substrs=[33                "error: Function name regular expression could "34                + "not be compiled: repetition-operator operand invalid",35                "warning: Function name regex does not accept glob patterns.",36            ],37        )38        # Make sure that warning is only shown for invalid regular expressions39        # that look like a globbing expression (i.e., they have a leading * or ?).40        self.expect(41            "breakpoint set --func-regex a*+",42            error=True,43            matching=False,44            substrs=["warning: Function name regex does not accept glob patterns."],45        )46        self.expect(47            "breakpoint set --func-regex a?+",48            error=True,49            matching=False,50            substrs=["warning: Function name regex does not accept glob patterns."],51        )52