description = '''
javascript unicode mode tests. all tests run with UnicodeMode::Javascript.
'''
[[test]]
name = "trailing_la_dot_alt_eol"
pattern = '.(?=a|$)'
input = "xa xb x\nxc x"
matches = [[0, 1], [6, 7], [11, 12]]
[[test]]
name = "whenever_js_prefix"
pattern = '^(?:WHENEVER\b)'
input = "WHENEVER you look at this pattern"
matches = [[0, 8]]
[[test]]
name = "trailing_la_word_alt_eol"
pattern = '\w(?=a|$)'
input = "xa xb x\nxc x"
matches = [[0, 1], [6, 7], [11, 12]]
[[test]]
name = "alt_prefix_emu_dfn_mixed"
pattern = 'EMU-(?!CLAUSE|XREF|ANNEX|INTRO)|DFN'
input = "DFN foo EMU-XX bar EMU-CLAUSE baz DFN qux"
matches = [[0, 3], [8, 12], [34, 37]]
[[test]]
name = "trailing_star_branch_saturating"
pattern = '(\S+)(?:\s+([\s\S]+))?'
input = "abc def ghi"
matches = [[0, 11]]
[[test]]
name = "trailing_star_branch_eps_with_trailing_ws"
pattern = '(\S+)(?:\s+([\s\S]+))?'
input = "abc "
matches = [[0, 3]]
[[test]]
name = "trailing_star_branch_eps_no_ws"
pattern = '(\S+)(?:\s+([\s\S]+))?'
input = "abc"
matches = [[0, 3]]
[[test]]
name = "trailing_star_branch_trailing_tab"
pattern = '(\S+)(?:\s+([\s\S]+))?'
input = "ab\t"
matches = [[0, 2]]
[[test]]
name = "trailing_star_branch_leading_ws"
pattern = '(\S+)(?:\s+([\s\S]+))?'
input = " abc def"
matches = [[3, 10]]
[[test]]
name = "trailing_star_branch_empty"
pattern = '(\S+)(?:\s+([\s\S]+))?'
input = ""
matches = []
[[test]]
name = "trailing_dollar_with_dollar_match"
pattern = '[\s\(\/][\S\s]+$'
input = "abc (def ghi"
matches = [[3, 12]]
[[test]]
name = "trailing_dollar_with_dollar_nomatch"
pattern = '[\s\(\/][\S\s]+$'
input = "abcdef"
matches = []
[[test]]
name = "trailing_dollar_without_dollar_match"
pattern = '[\s\(\/][\S\s]+'
input = "abc (def ghi"
matches = [[3, 12]]
[[test]]
name = "trailing_dollar_with_dollar_short"
pattern = '[\s\(\/][\S\s]+$'
input = "abc def"
matches = [[3, 7]]
[[test]]
name = "trailing_star_fastpath_lb_stripped_neg_la"
pattern = '^(?!a).[\s\S]*'
input = "ab"
matches = []
[[test]]
name = "lb_stripped_complex_no_match_with_trailing"
pattern = '^((?!\_\S+=)[^\s]+)\s?([\S\s]*)$'
input = "_FOO=1 trailing"
matches = []
[[test]]
name = "lb_stripped_complex_no_match"
pattern = '^((?!\_\S+=)[^\s]+)\s?([\S\s]*)$'
input = "_FOO=1"
matches = []
[[test]]
name = "lb_stripped_complex_single_byte"
pattern = '^((?!\_\S+=)[^\s]+)\s?([\S\s]*)$'
input = "a"
matches = [[0, 1]]
[[test]]
name = "lb_stripped_complex_three_bytes"
pattern = '^((?!\_\S+=)[^\s]+)\s?([\S\s]*)$'
input = "abc"
matches = [[0, 3]]
[[test]]
name = "anchored_fwd_lb_simple_match"
pattern = '^(?!\_\S+=)\S+'
input = "abc"
matches = [[0, 3]]
[[test]]
name = "anchored_fwd_lb_simple_no_match"
pattern = '^(?!\_\S+=)\S+'
input = "_FOO=1"
matches = []
[[test]]
name = "breaking_change_no_match"
pattern = 'BREAKING CHANGE:([\s\S]*)'
input = "hello world"
matches = []
[[test]]
name = "breaking_change_with_prefix"
pattern = 'BREAKING CHANGE:([\s\S]*)'
input = "foo BREAKING CHANGE: drops API"
matches = [[4, 30]]
[[test]]
name = "breaking_change_two_occurrences"
pattern = 'BREAKING CHANGE:([\s\S]*)'
input = "BREAKING CHANGE: a\nBREAKING CHANGE: b"
matches = [[0, 37]]
[[test]]
name = "wb_nullable_word_star_no_split"
pattern = 'cat\b\w*'
input = "category"
matches = []
[[test]]
name = "wb_word_no_split"
pattern = 'cat\b\w'
input = "category"
matches = []
[[test]]
name = "wb_charclass_no_split"
pattern = 'cat\b[a-z]'
input = "category"
matches = []
[[test]]
name = "wb_nullable_charclass_star_no_split"
pattern = 'cat\b[a-z]*'
input = "category"
matches = []
[[test]]
name = "wb_literal_no_split"
pattern = 'cat\be'
input = "category"
matches = []
[[test]]
name = "wb_bare_no_split"
pattern = 'cat\b'
input = "category"
matches = []
[[test]]
name = "wb_bare_at_space"
pattern = 'cat\b'
input = "cat dog"
matches = [[0, 3]]
[[test]]
name = "wb_html_tag_negclass_star"
pattern = '<script\b[^<]*'
input = "<scripts!</script>)<"
matches = []
[[test]]
name = "begin_anchored_wb_abc_abcd"
pattern = '\Aabc\b'
input = "abcd"
matches = []
[[test]]
name = "begin_anchored_wb_abc_def"
pattern = '\Aabc\b'
input = "abc def"
matches = [[0, 3]]
[[test]]
name = "begin_anchored_wb_word_plus"
pattern = '\A\w+\b'
input = "abc def"
matches = [[0, 3]]
[[test]]
name = "stacked_neg_lb_word_dash_if"
pattern = '(?<!\w)(?<!-)if'
input = "specified"
matches = []
[[test]]
name = "wb_neg_lb_dash_if_specified"
pattern = '\b(?<!-)if'
input = "specified"
matches = []
[[test]]
name = "wb_neg_lb_dash_if_x"
pattern = '\b(?<!-)if'
input = "if x"
matches = [[0, 2]]
[[test]]
name = "wb_neg_lb_dash_dashif"
pattern = '\b(?<!-)if'
input = "-if"
matches = []
[[test]]
name = "stacked_neg_lb_ab_c_zc"
pattern = '(?<!a)(?<!b)c'
input = "zc"
matches = [[1, 2]]
[[test]]
name = "stacked_neg_lb_ab_c_ac"
pattern = '(?<!a)(?<!b)c'
input = "ac"
matches = []
[[test]]
name = "stacked_neg_lb_ab_c_bc"
pattern = '(?<!a)(?<!b)c'
input = "bc"
matches = []
[[test]]
name = "rust_numeric_literal_suffix_limited"
pattern = '((?:\.\.)?)(?:\b0b\.?|\b|\.)\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:e[+-]?\d[\d_]*)?[ulfi]{0,4}'
input = " encoding = 'utf8';"
expect_error = true
[[test]]
name = "signed_decimal_word_boundary_lower_exp"
pattern = '(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b'
input = " encoding = 'utf8';"
expect_error = true
[[test]]
name = "lowercase_dotted_identifier_before_assignment"
pattern = '(?:\b|\B\.)[a-z_]\w*(?:\.[a-z_]\w*)*(?=\s+[a-z_]\w*\s*[=;])'
input = ' <h4 class="d-flex justify-content-between align-items-center mb-3">'
expect_error = true
[[test]]
name = "object_key_before_colon_not_equals"
pattern = '(^|[^\\.])(?:"(?:\\.|[^\\"\r\n])*"|`[^`]*`|\b[a-z_]\w*\b)(?=\s*:(?!=))'
input = "app.del = deprecate.function(app.delete, 'app.del: Use app.delete instead');"
expect_error = true
[[test]]
name = "hyphenated_identifier_not_followed_by_word_or_dash"
pattern = '(?:\B-|\b_|\b)[A-Za-z][\w-]*(?![\w-])'
input = " i = 0;"
expect_error = true
[[test]]
name = "rust_numeric_literal_suffix_unbounded"
pattern = '((?:\.\.)?)(?:\b0b\.?|\b|\.)\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:e[+-]?\d[\d_]*)?[ulfi]*'
input = " encoding = 'utf8';"
expect_error = true
[[test]]
name = "ascii_dotted_identifier_before_assignment"
pattern = '(?:\b|\B\.)[A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*(?=\s+[A-Za-z_]\w*\s*[=;])'
input = ' <h4 class="d-flex justify-content-between align-items-center mb-3">'
expect_error = true
[[test]]
name = "spaces_not_inside_parentheses"
pattern = '(?<!\([^)]*)\s+'
input = "> extends ComponentInternalOptions {"
matches = [[1, 2], [9, 10], [34, 35]]
[[test]]
name = "numeric_literal_optional_sign_and_exponent"
pattern = '(?:\b|-)\d*\.?\d+([Ee][+-]?\d+)?\b'
input = " this.set('subdomain offset', 2);"
expect_error = true
[[test]]
name = "signed_decimal_word_boundary_any_exp"
pattern = '(?:\B-|\b)\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b'
input = " encoding = 'utf8';"
expect_error = true