From 3916948004dadc045739c786236ccda82590a130 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Tue, 12 Dec 2023 22:51:56 -0700 Subject: add initial swiftGopherClient --- .../swiftGopherClientTests.swift | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Tests/swiftGopherClientTests/swiftGopherClientTests.swift (limited to 'Tests') 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) + } +} -- cgit v1.2.3