-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '287-don-t-attempt-to-generate-cgimage-of-zero-size' int…
…o 'release/23.3' Resolve "Don't attempt to generate CGImage of zero size" Closes #287 See merge request highlighter/app!258
- Loading branch information
Showing
15 changed files
with
286 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
Modules/Legacy/Editing/Tests/Extensions/UIBezierPathExtensionsTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Created by Geoff Pado on 10/19/23. | ||
// Copyright © 2023 Cocoatype, LLC. All rights reserved. | ||
|
||
import XCTest | ||
|
||
@testable import Editing | ||
|
||
final class UIBezierPathExtensionsTests: XCTestCase { | ||
func testCreatingShape() throws { | ||
let path = UIBezierPath() | ||
path.move(to: CGPoint(x: 0, y: 0)) | ||
path.addLine(to: CGPoint(x: 0, y: 5)) | ||
path.addLine(to: CGPoint(x: 5, y: 5)) | ||
path.addLine(to: CGPoint(x: 5, y: 0)) | ||
path.close() | ||
|
||
let shape = try XCTUnwrap(path.shape) | ||
XCTAssertEqual(shape, TestHelpers.shape) | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
Modules/Legacy/Editing/Tests/Redactions/CharacterObservationRedactionTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Created by Geoff Pado on 10/19/23. | ||
// Copyright © 2023 Cocoatype, LLC. All rights reserved. | ||
|
||
import XCTest | ||
|
||
@testable import Editing | ||
|
||
final class CharacterObservationRedactionTests: XCTestCase { | ||
#if canImport(UIKit) | ||
func testInitIgnoresEmptyShapes() throws { | ||
let observation = CharacterObservation(bounds: TestHelpers.emptyShape, textObservationUUID: UUID()) | ||
let redaction = try XCTUnwrap(Redaction([observation], color: .black)) | ||
|
||
XCTAssertEqual(redaction.parts.count, 0) | ||
} | ||
|
||
func testInitIncludesNonEmptyShapes() throws { | ||
let observation = CharacterObservation(bounds: TestHelpers.shape, textObservationUUID: UUID()) | ||
let redaction = try XCTUnwrap(Redaction([observation], color: .black)) | ||
|
||
XCTAssertEqual(redaction.parts.count, 1) | ||
} | ||
#endif | ||
} |
Oops, something went wrong.