def test_necessary_x_flag_2(self): r = Regex.get_parse_tree(r"(?x)foo#comment") errs = [] check_bad_flags(r, errs) print(errs) self.assertEqual(len(errs), 0)
def test_necessary_i_flag2(self): r = Regex.get_parse_tree(r"(?m).$") errs = [] check_bad_flags(r, errs) print(errs) self.assertEqual(len(errs), 0)
def test_unnecessary_x_flag(self): r = Regex.get_parse_tree(r"(?x)foo[ ]") errs = [] check_bad_flags(r, errs) print(errs) self.assertEqual(len(errs), 1)
def test_necessary_i_flag_in_alternation3(self): r = Regex.get_parse_tree(r"(?i)[\x00-\x67]") errs = [] check_bad_flags(r, errs) print(errs) self.assertEqual(len(errs), 0)