Update ViewInspector to 0.9.1

This commit is contained in:
DreamPiggy 2022-09-15 17:18:43 +08:00
parent 4b7cbfcf06
commit ac0e73b1f8
2 changed files with 9 additions and 9 deletions

View File

@ -1436,8 +1436,8 @@
isa = XCRemoteSwiftPackageReference; isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/nalexn/ViewInspector.git"; repositoryURL = "https://github.com/nalexn/ViewInspector.git";
requirement = { requirement = {
kind = upToNextMajorVersion; kind = exactVersion;
minimumVersion = 0.3.11; version = 0.9.1;
}; };
}; };
/* End XCRemoteSwiftPackageReference section */ /* End XCRemoteSwiftPackageReference section */

View File

@ -23,9 +23,9 @@ class WebImageTests: XCTestCase {
let imageView = WebImage(url: imageUrl) let imageView = WebImage(url: imageUrl)
let introspectView = imageView.onSuccess { image, data, cacheType in let introspectView = imageView.onSuccess { image, data, cacheType in
#if os(macOS) #if os(macOS)
let displayImage = try? imageView.inspect().group().image(0).nsImage() let displayImage = try? imageView.inspect().group().image(0).actualImage.nsImage()
#else #else
let displayImage = try? imageView.inspect().group().image(0).cgImage() let displayImage = try? imageView.inspect().group().image(0).actualImage().cgImage()
#endif #endif
XCTAssertNotNil(displayImage) XCTAssertNotNil(displayImage)
expectation.fulfill() expectation.fulfill()
@ -47,10 +47,10 @@ class WebImageTests: XCTestCase {
if let animatedImage = image as? SDAnimatedImage { if let animatedImage = image as? SDAnimatedImage {
XCTAssertTrue(imageView.isAnimating) XCTAssertTrue(imageView.isAnimating)
#if os(macOS) #if os(macOS)
let displayImage = try? imageView.inspect().group().image(0).nsImage() let displayImage = try? imageView.inspect().group().image(0).actualImage().nsImage()
let size = displayImage?.size let size = displayImage?.size
#else #else
let displayImage = try? imageView.inspect().group().image(0).cgImage() let displayImage = try? imageView.inspect().group().image(0).actualImage().cgImage()
let size = CGSize(width: displayImage?.width ?? 0, height: displayImage?.height ?? 0) let size = CGSize(width: displayImage?.width ?? 0, height: displayImage?.height ?? 0)
#endif #endif
XCTAssertNotNil(displayImage) XCTAssertNotNil(displayImage)
@ -161,11 +161,11 @@ class WebImageTests: XCTestCase {
let imageView = WebImage(url: imageUrl) let imageView = WebImage(url: imageUrl)
let introspectView = imageView.onSuccess { image, data, cacheType in let introspectView = imageView.onSuccess { image, data, cacheType in
#if os(macOS) #if os(macOS)
let displayImage = try? imageView.inspect().group().image(0).nsImage() let displayImage = try? imageView.inspect().group().image(0).actualImage().nsImage()
XCTAssertNotNil(displayImage) XCTAssertNotNil(displayImage)
#else #else
let displayImage = try? imageView.inspect().group().image(0).cgImage() let displayImage = try? imageView.inspect().group().image(0).actualImage().cgImage()
let orientation = try? imageView.inspect().group().image(0).orientation() let orientation = try? imageView.inspect().group().image(0).actualImage().orientation()
XCTAssertNotNil(displayImage) XCTAssertNotNil(displayImage)
XCTAssertEqual(orientation, .leftMirrored) XCTAssertEqual(orientation, .leftMirrored)
#endif #endif