File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 44
55include (" pcre.jl" )
66
7- const DEFAULT_COMPILER_OPTS = PCRE. UTF | PCRE. NO_UTF_CHECK | PCRE . ALT_BSUX
8- const DEFAULT_MATCH_OPTS = PCRE . NO_UTF_CHECK
7+ const DEFAULT_COMPILER_OPTS = PCRE. UTF | PCRE. ALT_BSUX
8+ const DEFAULT_MATCH_OPTS = zero (UInt32)
99
1010mutable struct Regex
1111 pattern:: String
Original file line number Diff line number Diff line change 4949
5050# Proper unicode handling
5151@test match (r" ∀∀" , " ∀x∀∀∀" ). match == " ∀∀"
52+
53+ @test_throws ErrorException match (r" a" , " \x e2\x 88" ) # 1 byte missing at end
54+ @test_throws ErrorException match (r" a" , " \x e2\x 08\x 80" ) # byte 2 top bits not 0x80
55+ @test_throws ErrorException match (r" a" , " \x f8\x 89\x 89\x 80\x 80" ) # 5-byte character is not allowed (RFC 3629)
56+ @test_throws ErrorException match (r" a" , " \U DFFF" ) # code points 0xd800-0xdfff are not defined
57+ @test_throws ErrorException match (r" a" , " \x c0\x 80" ) # overlong 2-byte sequence
58+ @test_throws ErrorException match (r" a" , " \x ff" ) # illegal byte (0xfe or 0xff)
59+
60+ @test_throws ErrorException Regex (" \x e2\x 88" ) # 1 byte missing at end
61+ @test_throws ErrorException Regex (" \x e2\x 08\x 80" ) # byte 2 top bits not 0x80
62+ @test_throws ErrorException Regex (" \x f8\x 89\x 89\x 80\x 80" ) # 5-byte character is not allowed (RFC 3629)
63+ @test_throws ErrorException Regex (" \U DFFF" ) # code points 0xd800-0xdfff are not defined
64+ @test_throws ErrorException Regex (" \x c0\x 80" ) # overlong 2-byte sequence
65+ @test_throws ErrorException Regex (" \x ff" ) # illegal byte (0xfe or 0xff)
You can’t perform that action at this time.
0 commit comments