Repository: vapor/vapor
File: Tests/VaporTests/RouteTests.swift (Swift)

Code before:
                #expect(leadingAndMiddleDoubleSlash.status == .ok)

                let leadingMiddleAndTrailingDoubleSlash = try await testApp.sendRequest(.get, "//foop//barp//buz")
                #expect(leadingMiddleAndTrailingDoubleSlash.body.string == "foopbarp")
                #expect(leadingMiddleAndTrailingDoubleSlash.status == .ok)

                let middleDoubleSlash = try await testApp.sendRequest(.get, "/foop//barp/buz")
                #expect(middleDoubleSlash.body.string == "foopbarp")
                #expect(middleDoubleSlash.status == .ok)

                let middleAndTrailingDoubleSlash = try await testApp.sendRequest(.get, "/foop//barp//buz")
                #expect(middleAndTrailingDoubleSlash.body.string == "foopbarp")
                #expect(middleAndTrailingDoubleSlash.status == .ok)

                let trailingDoubleSlash = try await testApp.sendRequest(.get, "/foop/barp//buz")
                #expect(trailingDoubleSlash.body.string == "foopbarp")
                #expect(trailingDoubleSlash.status == .ok)

                let leadingAndTrailingDoubleSlash = try await testApp.sendRequest(.get, "//foop/barp//buz")
                #expect(leadingAndTrailingDoubleSlash.body.string == "foopbarp")
                #expect(leadingAndTrailingDoubleSlash.status == .ok)
            }
        }
    }

    @Test("Catch all HTTP methods", .bug("https://github.com/vapor/vapor/issues/1887#event-20997694543"))
    func testCatchAllHTTPMethods() async throws {
        try await withApp { app in
            app.routes.all("universal") { req -> String in
                req.method.rawValue
            }

            let methods: [HTTPRequest.Method] = [.get, .post, .put, .patch, .delete, .head, .options]
            for method in methods {
                try await app.testing().test(method, "/universal") { res in
                    #expect(res.status == .ok)
                    #expect(res.body.string == method.rawValue)
                }
            }
        }
    }
}


Review comment (bug):
```suggestion
    @Test("Catch all HTTP methods", .bug("https://github.com/vapor/vapor/issues/1887"))
```

Code after:
                let leadingAndMiddleDoubleSlash = try await testApp.sendRequest(.get, "//foop//barp/buz")
                #expect(leadingAndMiddleDoubleSlash.body.string == "foopbarp")
                #expect(leadingAndMiddleDoubleSlash.status == .ok)

                let leadingMiddleAndTrailingDoubleSlash = try await testApp.sendRequest(.get, "//foop//barp//buz")
                #expect(leadingMiddleAndTrailingDoubleSlash.body.string == "foopbarp")
                #expect(leadingMiddleAndTrailingDoubleSlash.status == .ok)

                let middleDoubleSlash = try await testApp.sendRequest(.get, "/foop//barp/buz")
                #expect(middleDoubleSlash.body.string == "foopbarp")
                #expect(middleDoubleSlash.status == .ok)

                let middleAndTrailingDoubleSlash = try await testApp.sendRequest(.get, "/foop//barp//buz")
                #expect(middleAndTrailingDoubleSlash.body.string == "foopbarp")
                #expect(middleAndTrailingDoubleSlash.status == .ok)

                let trailingDoubleSlash = try await testApp.sendRequest(.get, "/foop/barp//buz")
                #expect(trailingDoubleSlash.body.string == "foopbarp")
                #expect(trailingDoubleSlash.status == .ok)

                let leadingAndTrailingDoubleSlash = try await testApp.sendRequest(.get, "//foop/barp//buz")
                #expect(leadingAndTrailingDoubleSlash.body.string == "foopbarp")
                #expect(leadingAndTrailingDoubleSlash.status == .ok)
            }
        }
    }

    @Test("Catch all HTTP methods", .bug("https://github.com/vapor/vapor/issues/1887"))
    func testCatchAllHTTPMethods() async throws {
        try await withApp { app in
            app.routes.all("universal") { req -> String in
                req.method.rawValue
            }

            let methods: [HTTPRequest.Method] = [.get, .post, .put, .patch, .delete, .head, .options]
            for method in methods {
                try await app.testing().test(method, "/universal") { res in
                    #expect(res.status == .ok)
                    #expect(res.body.string == method.rawValue)
                }
            }
        }
    }

    @Test("Unicode Routing", .bug("https://github.com/vapor/vapor/issues/3309"))
    func unicodeRouting() async throws {
        try await withApp { app in
            app.get("Good👍") { req in
                return "👍"
            }
            app.get("ようこそ世界へ") { req in