1414//===----------------------------------------------------------------------===//
1515import HTTPTypes
1616import OpenAPIRuntime
17+ import Testing
1718
1819@testable import OpenAPILambda
1920
20- // only run unit tests on Swift 6.x
21- #if swift(>=6.0)
22- import Testing
23-
2421struct RouterGraphTests {
2522 @Test ( " Path with no parameters " )
2623 func testPathNoParams( ) async throws {
@@ -231,7 +228,7 @@ struct RouterGraphTests {
231228 // let method = HTTPRequest.Method(strMethod)!
232229 // let graph = prepareGraph(for: method)
233230 //
234- // let root: Node ? = graph.root()
231+ // let root: node ? = graph.root()
235232 // XCTAssertNotNil(root)
236233 //
237234 // // when
@@ -323,9 +320,8 @@ struct RouterGraphTests {
323320
324321 //when
325322 #expect( throws: Never . self) { try graph. find ( method: method, path: pathToTest) }
326- let ( handler , metadata) = try graph. find ( method: method, path: pathToTest)
323+ let ( _ , metadata) = try graph. find ( method: method, path: pathToTest)
327324 #expect( metadata. count == 0 )
328- #expect( handler != nil )
329325 }
330326
331327 @Test (
@@ -338,19 +334,18 @@ struct RouterGraphTests {
338334 )
339335 func testFindHandler2(
340336 pathToTest: String
341- ) throws {
337+ ) async throws {
342338 // given
343339 let strMethod = " GET "
344340 let method = HTTPRequest . Method ( strMethod) !
345341 let graph = prepareGraphForFind ( for: method)
346342
347343 //when
348344 #expect( throws: Never . self) {
349- let ( handler , metadata) = try graph. find ( method: method, path: pathToTest)
345+ let ( _ , metadata) = try graph. find ( method: method, path: pathToTest)
350346
351347 // then (we can not test if the query string param have been decoded, that's the job of the openapi runtime.)
352348 #expect( metadata. count == 1 )
353- #expect( handler != nil )
354349 }
355350
356351 }
@@ -365,9 +360,8 @@ struct RouterGraphTests {
365360
366361 //when
367362 #expect( throws: Never . self) { try graph. find ( method: method, path: pathToTest) }
368- let ( handler , metadata) = try graph. find ( method: method, path: pathToTest)
363+ let ( _ , metadata) = try graph. find ( method: method, path: pathToTest)
369364 #expect( metadata. count == 1 )
370- #expect( handler != nil )
371365 }
372366
373367 @Test ( " Find handler error 1 " )
@@ -440,4 +434,3 @@ struct RouterGraphTests {
440434 }
441435
442436}
443- #endif
0 commit comments