@@ -16,36 +16,44 @@ import XCTest
1616
1717extension CaptureList . Capture {
1818 static var cap : Self {
19- return Self ( optionalDepth: 0 )
19+ return Self ( optionalDepth: 0 , . fake )
2020 }
2121
2222 static var opt : Self {
23- return Self ( optionalDepth: 1 )
23+ return Self ( optionalDepth: 1 , . fake )
2424 }
2525 static var opt_opt : Self {
26- return Self ( optionalDepth: 2 )
26+ return Self ( optionalDepth: 2 , . fake )
2727 }
2828 static var opt_opt_opt : Self {
29- return Self ( optionalDepth: 3 )
29+ return Self ( optionalDepth: 3 , . fake )
3030 }
3131 static var opt_opt_opt_opt : Self {
32- return Self ( optionalDepth: 4 )
32+ return Self ( optionalDepth: 4 , . fake )
3333 }
3434 static var opt_opt_opt_opt_opt : Self {
35- return Self ( optionalDepth: 5 )
35+ return Self ( optionalDepth: 5 , . fake )
3636 }
3737 static var opt_opt_opt_opt_opt_opt : Self {
38- return Self ( optionalDepth: 6 )
38+ return Self ( optionalDepth: 6 , . fake )
3939 }
4040
4141 static func named( _ name: String , opt: Int = 0 ) -> Self {
42- return Self ( name: name, optionalDepth: opt)
42+ return Self ( name: name, optionalDepth: opt, . fake )
4343 }
4444}
4545extension CaptureList {
4646 static func caps( count: Int ) -> Self {
4747 Self ( Array ( repeating: . cap, count: count) )
4848 }
49+
50+ var withoutLocs : Self {
51+ var copy = self
52+ for idx in copy. captures. indices {
53+ copy. captures [ idx] . location = . fake
54+ }
55+ return copy
56+ }
4957}
5058
5159extension StructuredCapture {
@@ -151,7 +159,7 @@ func captureTest(
151159 line: UInt = #line
152160) {
153161 let ast = try ! parse ( regex, . semantic, . traditional)
154- let capList = ast. root. _captureList
162+ let capList = ast. root. _captureList. withoutLocs
155163 guard capList == expected else {
156164 XCTFail ( """
157165 Expected:
0 commit comments