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 11import Foundation
22
33func urlSplitFragment( url: String ) -> ( String , String ) {
4+ #if swift(>=5.0)
5+ guard let hashIndex = url. firstIndex ( of: " # " ) else {
6+ return ( url, " " )
7+ }
8+ #else
49 guard let hashIndex = url. index ( of: " # " ) else {
510 return ( url, " " )
611 }
12+ #endif
713
814 return (
915 String ( url. prefix ( upTo: hashIndex) ) ,
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public let testRequired: ((ContextType) -> Void) = {
2121 let error = errors [ 0 ]
2222
2323 try expect ( error. description) == " Required property 'test' is missing "
24- try expect ( error. instanceLocation. path) == " /0 "
24+ try expect ( error. instanceLocation. path) == " /0/test "
2525 try expect ( error. keywordLocation. path) == " #/items/required "
2626 }
2727 }
You can’t perform that action at this time.
0 commit comments