description = "negative tests for invalid patterns"
[[test]]
name = "unclosed_class"
pattern = "[unclosed"
expect_error = true
reason = "ClassUnclosed"
[[test]]
name = "unclosed_group"
pattern = "(unclosed"
expect_error = true
reason = "GroupUnclosed"
[[test]]
name = "repetition_missing_operand"
pattern = "*"
expect_error = true
reason = "RepetitionMissing"
[[test]]
name = "class_range_invalid"
pattern = "[z-a]"
expect_error = true
reason = "ClassRangeInvalid"
[[test]]
name = "escape_hex_invalid"
pattern = '\xGG'
expect_error = true
reason = "EscapeHexInvalid"
[[test]]
name = "group_name_empty"
pattern = "(?P<>abc)"
expect_error = true
reason = "GroupNameEmpty"
[[test]]
name = "unclosed_repetition"
pattern = "a{3"
expect_error = true
reason = "RepetitionCountUnclosed"
[[test]]
name = "nested_unclosed_group"
pattern = "((abc)"
expect_error = true
reason = "GroupUnclosed nested"
[[test]]
name = "invalid_escape"
pattern = '\p{InvalidPropertyName}'
expect_error = true
reason = "UnicodePropertyNotFound"
[[test]]
name = "empty_pattern_repetition"
pattern = "+abc"
expect_error = true
reason = "RepetitionMissing plus"
[[test]]
name = "unclosed_class_negated"
pattern = "[^abc"
expect_error = true
reason = "ClassUnclosed negated"
[[test]]
name = "swap_greed_flag_inline"
pattern = '(?U).*'
expect_error = true
reason = "SwapGreed flag unsupported"
[[test]]
name = "swap_greed_flag_group"
pattern = '(?U:.*?)'
expect_error = true
reason = "SwapGreed flag in group unsupported"
[[test]]
name = "word_boundary_dot_star_word_boundary"
pattern = 'a\b.*\bb'
expect_error = true
reason = "word boundary consumed by .*"
[[test]]
name = "neg_la_dot_star"
pattern = '((?!ab).)*'
expect_error = true
reason = "union branch with lookahead under star"
[[test]]
name = "neg_la_dot_star_anchored"
pattern = '^((?!ab).)*$'
expect_error = true
reason = "union branch with lookahead under star"
[[test]]
name = "neg_la_dot_star_alt_prefix"
pattern = 'QQQ|^((?!ab).)*$'
expect_error = true
reason = "union branch with lookahead under star"
[[test]]
name = "neg_la_dot_star_node_modules"
pattern = 'node_modules|^((?!\.(test|mock)\.).)*$'
expect_error = true
reason = "union branch with lookahead under star"
[[test]]
name = "rev_collect_candidate_without_fwd_end"
pattern = '((?<!b)(?=b)|-)b(?!b)'
expect_error = true
reason = "rev-collect candidate missing forward end"
[[test]]
name = "lookbehind_after_consuming"
pattern = '[\s\S]+(?<=\S)\z'
expect_error = true
reason = "lookbehind after consuming before anchor"
[[test]]
name = "quantified_multichar_neg_lookahead_body"
pattern = '(?:(?!bc)[^\n\r])+'
expect_error = true
reason = "quantified negative lookahead over negated class"
[[test]]
name = "quantified_multichar_neg_lookahead_body_optional_then_literal"
pattern = '((?:(?!bc)[^\n\r])+)?x'
expect_error = true
reason = "quantified negative lookahead over negated class"
[[test]]
name = "quantified_multichar_neg_lookahead_body_between_literals"
pattern = '<%((?:(?!%>).)+)?%>'
expect_error = true
reason = "quantified negative lookahead over dot"
[[test]]
name = "nested_lookahead_lookbehind_after_consuming_atom"
pattern = '(?=.(?=(?<!cc)a))c+'
expect_error = true
reason = "fused lookbehind after consuming atom"
[[test]]
name = "ascii_mode_quantified_double_negation_nested_lookbehind"
pattern = '((?!(?!(?=(?=.(?=(?<!.a)a)))[^a]))){1,2}.*'
ascii = true
expect_error = true
reason = "same shape via doubled negation"
[[test]]
name = "two_sequential_optional_negative_lookbehinds_before_lookahead"
pattern = '((?<!c))?((?<!c))?(?=a)'
expect_error = true
reason = "two optional lookbehinds yield spurious match"
[[test]]
name = "quantified_word_boundary_bounded"
pattern = '\b{1,3}'
expect_error = true
reason = "quantified word boundary rejected"
[[test]]
name = "quantified_word_boundary_after_end_anchor"
pattern = '\z\b{1,3}'
expect_error = true
reason = "quantified word boundary rejected"
[[test]]
name = "quantified_word_boundary_after_literal_end_anchor"
pattern = 'a\z\b{1,3}'
expect_error = true
reason = "quantified word boundary rejected"
[[test]]
name = "quantified_non_word_boundary_bounded"
pattern = '\B{1,3}'
expect_error = true
reason = "quantified word boundary rejected"
[[test]]
name = "quantified_non_word_boundary_after_end_anchor"
pattern = '\z\B{1,3}'
expect_error = true
reason = "quantified word boundary rejected"
[[test]]
name = "optional_caret_before_non_word_boundary"
pattern = '^?\B'
expect_error = true
reason = "optional lookbehind before word boundary rejected"
[[test]]
name = "optional_caret_before_word_boundary"
pattern = '^?\b'
expect_error = true
reason = "optional lookbehind before word boundary rejected"
[[test]]
name = "optional_lookbehind_begin_or_newline_before_non_word_boundary"
pattern = '(?<=\A|\n)?\B'
expect_error = true
reason = "optional lookbehind before word boundary rejected"
[[test]]
name = "optional_lookbehind_newline_before_non_word_boundary"
pattern = '(?<=\n)?\B'
expect_error = true
reason = "optional lookbehind before word boundary rejected"
[[test]]
name = "optional_lookbehind_begin_or_x_before_non_word_boundary"
pattern = '(?<=\A|x)?\B'
expect_error = true
reason = "optional lookbehind before word boundary rejected"
[[test]]
name = "optional_lookbehind_dash_before_non_word_boundary"
pattern = '(?<=-)?\B'
expect_error = true
reason = "optional lookbehind before word boundary rejected"
[[test]]
name = "optional_lookbehind_class_before_non_word_boundary"
pattern = '(?<=[^a-z])?\B'
expect_error = true
reason = "optional lookbehind before word boundary rejected"
[[test]]
name = "grouped_lookahead_before_non_word_boundary"
pattern = '(?=c)\B'
expect_error = true
reason = "grouped lookahead before word boundary rejected"
[[test]]
name = "wrapped_grouped_lookahead_before_non_word_boundary"
pattern = '((?=c))\B'
expect_error = true
reason = "grouped lookahead before word boundary rejected"
[[test]]
name = "wrapped_lookahead_x_before_non_word_boundary"
pattern = '((?=x))\B'
expect_error = true
reason = "grouped lookahead before word boundary rejected"
[[test]]
name = "wrapped_lookahead_optional_x_c_before_non_word_boundary"
pattern = '((?=x?c))\B'
expect_error = true
reason = "grouped lookahead before word boundary rejected"
[[test]]
name = "wrapped_lookahead_colon_c_before_non_word_boundary"
pattern = '((?=:c))\B'
expect_error = true
reason = "grouped lookahead before word boundary rejected"
[[test]]
name = "wrapped_lookahead_optional_a_c_before_non_word_boundary"
pattern = '((?=a?c))\B'
expect_error = true
reason = "grouped lookahead before word boundary rejected"
[[test]]
name = "fused_word_boundary_then_caret_before_begin_anchor"
pattern = '\b^.*\A'
ascii = true
expect_error = true
reason = "UnsupportedPattern"
[[test]]
name = "fused_word_boundary_then_grouped_caret_before_begin_anchor"
pattern = '\b(^).*\A[a]{0}((([^.a]))){0,2}'
ascii = true
expect_error = true
reason = "UnsupportedPattern"
[[test]]
name = "dollar_then_end_anchor_lookahead_then_non_word_boundary"
pattern = '$(?=\z)\B'
ascii = true
expect_error = true
reason = "UnsupportedPattern"
[[test]]
name = "dollar_then_word_boundary"
pattern = '$\b'
ascii = true
expect_error = true
reason = "UnsupportedPattern"
[[test]]
name = "quantified_end_anchor_lookahead_then_word_boundary"
pattern = '(?=\z+)\b'
ascii = true
expect_error = true
reason = "UnsupportedPattern"
[[test]]
name = "quantified_end_anchor_lookahead_then_dollar_then_word_boundary"
pattern = '(?=\z+)$\b'
ascii = true
expect_error = true
reason = "UnsupportedPattern"
[[test]]
name = "grouped_quantified_end_anchor_lookahead_then_dollar_then_repeated_word_boundary"
pattern = '((?=\z+))$.?\b{2}'
ascii = true
expect_error = true
reason = "UnsupportedPattern"
[[test]]
name = "exact_repeat_of_literal_or_lookbehind_alternation"
pattern = '(?:b|(?<=(?:-|:))){2}c'
ascii = true
expect_error = true
reason = "UnsupportedPattern: repeat unrolling duplicates a lookbehind alternation"
[[test]]
name = "two_two_repeat_of_literal_or_lookbehind_alternation"
pattern = '(?:b|(?<=(?:-|:))){2,2}c'
ascii = true
expect_error = true
reason = "UnsupportedPattern: repeat unrolling duplicates a lookbehind alternation"
[[test]]
name = "two_three_repeat_of_literal_or_lookbehind_alternation"
pattern = '(?:b|(?<=(?:-|:))){2,3}c'
ascii = true
expect_error = true
reason = "UnsupportedPattern: repeat unrolling duplicates a lookbehind alternation"
[[test]]
name = "exact_repeat_of_literal_or_single_byte_lookbehind_alternation"
pattern = '(?:b|(?<=-)){2}c'
ascii = true
expect_error = true
reason = "UnsupportedPattern: repeat unrolling duplicates a lookbehind alternation"
[[test]]
name = "exact_repeat_of_literal_or_captured_lookahead_alternation"
pattern = '(?:y|(?P<g0>(?!a))){2}.'
ascii = true
expect_error = true
reason = "UnsupportedPattern: repeat unrolling duplicates a captured lookahead alternation"
[[test]]
name = "bounded_repeat_of_literal_or_captured_lookahead_alternation"
pattern = '(?:y|(?P<g0>(?!a))){2,3}.'
ascii = true
expect_error = true
reason = "UnsupportedPattern: repeat unrolling duplicates a captured lookahead alternation"
[[test]]
name = "repeat_of_captured_union_wrapping_literal_or_lookahead"
pattern = '(?P<g0>(?:y|(?!a))){2}.'
ascii = true
expect_error = true
reason = "UnsupportedPattern: repeat unrolling duplicates a captured lookahead alternation"