-
Notifications
You must be signed in to change notification settings - Fork 129
Split out @testable tests #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split out @testable tests #51
Conversation
Tests/LinuxMain.swift
Outdated
@@ -27,6 +27,7 @@ import XCTest | |||
|
|||
XCTMain([ | |||
testCase(HTTPCookieTests.allTests), | |||
testCase(SwiftHTTPInternalTests.allTests), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the new suite which requires @testable
.
import NIOSSL | ||
|
||
class TestHTTPDelegate: HTTPClientResponseDelegate { | ||
typealias Response = Void | ||
|
||
var state = ResponseAccumulator.State.idle | ||
enum State { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@testable
was only required because we were piggy-backing on ResponseAccumulator.State
. As we're not using the rest of ResponseAccumulator
I think it's better to just define the state we need here.
|
||
extension SwiftHTTPInternalTests { | ||
static var allTests: [(String, (SwiftHTTPInternalTests) -> () throws -> Void)] { | ||
return [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the 5 tests which require @testable
.
@testable import NIOHTTP1 | ||
@testable import NIOHTTPClient | ||
import NIOSSL | ||
import NIOHTTP1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean up the imports while we're here. No need to use @testable
on NIO modules.
3a8ad1f
to
763cb05
Compare
That’s a great idea, thanks @ianpartridge . |
763cb05
to
f9c669c
Compare
Rebased, fixed conflicts, ready for review. |
Tests/NIOHTTPClientTests/SwiftNIOHTTPInternalTests+XCTest.swift
Outdated
Show resolved
Hide resolved
One small question but otherwise looks good @ianpartridge, thanks! |
Reduce the use of
@testable
. Where it is required, use it from a separate testsuite so its usage is more explicit.