File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Tests/JSONSchemaTests/Validation Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 1
1
import Foundation
2
2
3
3
func urlSplitFragment( url: String ) -> ( String , String ) {
4
+ #if swift(>=5.0)
5
+ guard let hashIndex = url. firstIndex ( of: " # " ) else {
6
+ return ( url, " " )
7
+ }
8
+ #else
4
9
guard let hashIndex = url. index ( of: " # " ) else {
5
10
return ( url, " " )
6
11
}
12
+ #endif
7
13
8
14
return (
9
15
String ( url. prefix ( upTo: hashIndex) ) ,
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public let testRequired: ((ContextType) -> Void) = {
21
21
let error = errors [ 0 ]
22
22
23
23
try expect ( error. description) == " Required property 'test' is missing "
24
- try expect ( error. instanceLocation. path) == " /0 "
24
+ try expect ( error. instanceLocation. path) == " /0/test "
25
25
try expect ( error. keywordLocation. path) == " #/items/required "
26
26
}
27
27
}
You can’t perform that action at this time.
0 commit comments