@@ -29,7 +29,7 @@ extension XCTestCase {
29
29
( _ seq1: @autoclosure ( ) throws -> S1 ,
30
30
_ seq2: @autoclosure ( ) throws -> S2 ,
31
31
_ message: @autoclosure ( ) -> String = " " ,
32
- file: StaticString = #file , line: UInt = #line)
32
+ file: StaticString = #filePath , line: UInt = #line)
33
33
where S1. Element: Sequence , S2. Element: Sequence , S1. Element. Element: Equatable ,
34
34
S1. Element. Element == S2 . Element . Element {
35
35
do {
@@ -44,14 +44,14 @@ extension XCTestCase {
44
44
}
45
45
46
46
func assertParseAll< Input: BidirectionalCollection >
47
- ( _ parser: Parser < Input > , input: Input , result: [ Input ] , file: StaticString = #file , line: UInt = #line)
47
+ ( _ parser: Parser < Input > , input: Input , result: [ Input ] , file: StaticString = #filePath , line: UInt = #line)
48
48
where Input. Element: Hashable {
49
49
let parsed = parser. ranges ( in: input) . map { input [ $0] }
50
50
XCTAssertEqualElements ( parsed, result, file: file, line: line)
51
51
}
52
52
53
53
func assertParseAll< P: Patterns . Pattern >
54
- ( _ pattern: P , input: P . Input , result: [ P . Input ] , file: StaticString = #file , line: UInt = #line) {
54
+ ( _ pattern: P , input: P . Input , result: [ P . Input ] , file: StaticString = #filePath , line: UInt = #line) {
55
55
do {
56
56
let parser = try Parser ( search: pattern)
57
57
assertParseAll ( parser, input: input, result: result, file: file, line: line)
@@ -61,7 +61,7 @@ extension XCTestCase {
61
61
}
62
62
63
63
func assertParseAll< Input: BidirectionalCollection >
64
- ( _ parser: Parser < Input > , input: Input , result: Input ? = nil , count: Int , file: StaticString = #file , line: UInt = #line)
64
+ ( _ parser: Parser < Input > , input: Input , result: Input ? = nil , count: Int , file: StaticString = #filePath , line: UInt = #line)
65
65
where Input. Element: Hashable {
66
66
if let result = result {
67
67
assertParseAll ( parser, input: input, result: Array ( repeating: result, count: count) , file: file, line: line)
@@ -73,7 +73,7 @@ extension XCTestCase {
73
73
}
74
74
75
75
func assertParseAll< P: Patterns . Pattern > ( _ pattern: P , input: P . Input , result: P . Input ? = nil , count: Int ,
76
- file: StaticString = #file , line: UInt = #line) {
76
+ file: StaticString = #filePath , line: UInt = #line) {
77
77
do {
78
78
let parser = try Parser ( search: pattern)
79
79
assertParseAll ( parser, input: input, result: result, count: count, file: file, line: line)
@@ -94,12 +94,12 @@ extension XCTestCase {
94
94
}
95
95
96
96
func assertParseMarkers< P: Patterns . Pattern > ( _ pattern: P , input: String ,
97
- file: StaticString = #file , line: UInt = #line) where P. Input == String {
97
+ file: StaticString = #filePath , line: UInt = #line) where P. Input == String {
98
98
assertParseMarkers ( try ! Parser ( search: pattern) , input: input, file: file, line: line)
99
99
}
100
100
101
101
func assertParseMarkers( _ pattern: Parser < String > , input: String ,
102
- file: StaticString = #file , line: UInt = #line) {
102
+ file: StaticString = #filePath , line: UInt = #line) {
103
103
let ( string, correct) = processMarkers ( input)
104
104
let parsedRanges = Array ( pattern. ranges ( in: string) )
105
105
XCTAssert ( parsedRanges. allSatisfy { $0. isEmpty } , " Not all results are empty ranges " ,
@@ -118,12 +118,12 @@ extension XCTestCase {
118
118
}
119
119
120
120
func assertCaptures< P: Patterns . Pattern > ( _ pattern: P , input: String , result: [ [ String ] ] ,
121
- file: StaticString = #file , line: UInt = #line) where P. Input == String {
121
+ file: StaticString = #filePath , line: UInt = #line) where P. Input == String {
122
122
assertCaptures ( try ! Parser ( search: pattern) , input: input, result: result, file: file, line: line)
123
123
}
124
124
125
125
func assertCaptures( _ pattern: Parser < String > , input: String , result: [ [ String ] ] ,
126
- file: StaticString = #file , line: UInt = #line) {
126
+ file: StaticString = #filePath , line: UInt = #line) {
127
127
let matches = Array ( pattern. matches ( in: input) )
128
128
let output = matches. map { match in match. captures. map { String ( input [ $0. range] ) } }
129
129
XCTAssertEqual ( output, result, file: file, line: line)
@@ -142,7 +142,7 @@ extension RangeReplaceableCollection where Self: BidirectionalCollection {
142
142
}
143
143
}
144
144
145
- func getLocalURL( for path: String , file: String = #file ) -> URL {
145
+ func getLocalURL( for path: String , file: String = #filePath ) -> URL {
146
146
URL ( fileURLWithPath: file)
147
147
. deletingLastPathComponent ( ) . appendingPathComponent ( path)
148
148
}
0 commit comments