diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2023-12-12 22:51:56 -0700 |
---|---|---|
committer | Navan Chauhan <navanchauhan@gmail.com> | 2023-12-12 22:51:56 -0700 |
commit | 3916948004dadc045739c786236ccda82590a130 (patch) | |
tree | 70bee6110898b2a31f80b5e048df5577dfc1f5da /Tests/swiftGopherClientTests | |
parent | 315e2510d577b7303f4b8204a4555aad26bc41a3 (diff) |
add initial swiftGopherClient1.0.0
Diffstat (limited to 'Tests/swiftGopherClientTests')
-rw-r--r-- | Tests/swiftGopherClientTests/swiftGopherClientTests.swift | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Tests/swiftGopherClientTests/swiftGopherClientTests.swift b/Tests/swiftGopherClientTests/swiftGopherClientTests.swift new file mode 100644 index 0000000..a687a3e --- /dev/null +++ b/Tests/swiftGopherClientTests/swiftGopherClientTests.swift @@ -0,0 +1,37 @@ +// +// swiftGopherClientTests.swift +// +// +// Created by Navan Chauhan on 12/12/23. +// + +import XCTest +import NIO + +@testable import swiftGopherClient + +final class GopherClientTests: XCTestCase { + + override func setUp() { + super.setUp() + } + + override func tearDown() { + super.tearDown() + } + + func testGopherServerConnection() { + let expectation = XCTestExpectation(description: "Connect and receive response from Gopher server") + let client = GopherClient() + client.sendRequest(to: "gopher.floodgap.com", message: "\r\n") { result in + switch result { + case .success(_): + expectation.fulfill() + case .failure(let error): + print("Error \(error)") + } + } + + wait(for: [expectation], timeout: 30) + } +} |