File tree Expand file tree Collapse file tree 2 files changed +4
-38
lines changed Expand file tree Collapse file tree 2 files changed +4
-38
lines changed Original file line number Diff line number Diff line change @@ -61,41 +61,6 @@ extension RegexTests {
61
61
_ = try src. lexNumber ( )
62
62
}
63
63
64
- func diagnoseUniScalarOverflow( _ input: String , base: Character ) {
65
- let scalars = input. first == " { "
66
- ? String ( input. dropFirst ( ) . dropLast ( ) )
67
- : input
68
- diagnose (
69
- input,
70
- expecting: . numberOverflow( scalars)
71
- ) { src in
72
- _ = try src. expectUnicodeScalar ( escapedCharacter: base)
73
- }
74
- }
75
- func diagnoseUniScalar(
76
- _ input: String ,
77
- base: Character ,
78
- expectedDigits numDigits: Int
79
- ) {
80
- let scalars = input. first == " { "
81
- ? String ( input. dropFirst ( ) . dropLast ( ) )
82
- : input
83
- diagnose (
84
- input,
85
- expecting: . expectedNumDigits( scalars, numDigits)
86
- ) { src in
87
- _ = try src. expectUnicodeScalar ( escapedCharacter: base)
88
- }
89
- _ = scalars
90
- }
91
-
92
- diagnoseUniScalar (
93
- " 12 " , base: " u " , expectedDigits: 4 )
94
- diagnoseUniScalar (
95
- " 12 " , base: " U " , expectedDigits: 8 )
96
- diagnoseUniScalarOverflow ( " {123456789} " , base: " u " )
97
- diagnoseUniScalarOverflow ( " {123456789} " , base: " x " )
98
-
99
64
// TODO: want to dummy print out source ranges, etc, test that.
100
65
}
101
66
Original file line number Diff line number Diff line change @@ -2872,9 +2872,10 @@ extension RegexTests {
2872
2872
diagnosticTest ( #"[\d--\u{a b}]"# , . unsupported( " scalar sequence in custom character class " ) )
2873
2873
diagnosticTest ( #"[\d--[\u{a b}]]"# , . unsupported( " scalar sequence in custom character class " ) )
2874
2874
2875
- // MARK: Unicode scalars
2876
-
2877
- diagnosticTest ( #"\u{G}"# , . expectedNumber( " G " , kind: . hex) )
2875
+ diagnosticTest ( #"\u12"# , . expectedNumDigits( " 12 " , 4 ) )
2876
+ diagnosticTest ( #"\U12"# , . expectedNumDigits( " 12 " , 8 ) )
2877
+ diagnosticTest ( #"\u{123456789}"# , . numberOverflow( " 123456789 " ) )
2878
+ diagnosticTest ( #"\x{123456789}"# , . numberOverflow( " 123456789 " ) )
2878
2879
2879
2880
// MARK: Matching options
2880
2881
You can’t perform that action at this time.
0 commit comments