-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[pointer_interceptor_ios] Migrate XCTest to Swift Testing #10762
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,26 +2,22 @@ | |
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| import Flutter | ||
| import Testing | ||
| import UIKit | ||
| import XCTest | ||
|
|
||
| @testable import pointer_interceptor_ios | ||
|
|
||
| class RunnerTests: XCTestCase { | ||
| func testNonDebugMode() { | ||
| @MainActor | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note if you don't use
Though the test still passed. I'm not sure how to make it an error instead of a warning, without converting the whole thing to a test plan (which seems overkill)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can make this an error by enabling the strict concurrency mode in build settings.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea, I'll play around with how to do that #10788 |
||
| struct RunnerTests { | ||
| @Test(arguments: [ | ||
| (false, UIColor.clear), | ||
| (true, UIColor(red: 1, green: 0, blue: 0, alpha: 0.5)), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. convenient! |
||
| ]) | ||
| func debugMode(debug: Bool, expectedColor: UIColor) { | ||
| let view = PointerInterceptorView( | ||
| frame: CGRect(x: 0, y: 0, width: 180, height: 48.0), debug: false) | ||
| frame: CGRect(x: 0, y: 0, width: 180, height: 48.0), debug: debug) | ||
|
|
||
| let debugView = view.view() | ||
| XCTAssertTrue(debugView.backgroundColor == UIColor.clear) | ||
| } | ||
|
|
||
| func testDebugMode() { | ||
| let view = PointerInterceptorView( | ||
| frame: CGRect(x: 0, y: 0, width: 180, height: 48.0), debug: true) | ||
|
|
||
| let debugView = view.view() | ||
| XCTAssertTrue(debugView.backgroundColor == UIColor(red: 1, green: 0, blue: 0, alpha: 0.5)) | ||
| #expect(debugView.backgroundColor == expectedColor) | ||
| } | ||
| } | ||

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.
does this version bump have any implication on developers?
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.
No, this is only the plugin example app project, it's not code or an Xcode project a plugin consumer would run.