Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/davidbalbert/Watt
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Apr 11, 2024
2 parents 76aff9b + 3f99976 commit ca660f4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
10 changes: 10 additions & 0 deletions Watt.xcodeproj/xcshareddata/xcschemes/Watt.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@
ReferencedContainer = "container:Watt.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
<CommandLineArgument
argument = "-_NS_4445425547"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "YES"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
8 changes: 6 additions & 2 deletions WattTests/LayoutManagerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ final class LayoutManagerTests: XCTestCase {

func testYOffsetAfterSplittingLine() {
class Delegate: NSObject, LayoutManagerDelegate {
func layoutManager(_ layoutManager: Watt.LayoutManager, rect: CGRect, didResizeTo new: CGSize) {

}

func viewportBounds(for layoutManager: LayoutManager) -> CGRect {
CGRect(x: 0, y: 0, width: 100, height: 100)
}
Expand Down Expand Up @@ -106,15 +110,15 @@ final class LayoutManagerTests: XCTestCase {
let delegate = Delegate()
l.delegate = delegate
// ensures layout info is cached
l.layoutText { _, _ in }
l.layoutText { _ in }

XCTAssertEqual(l.lineLayers.count, 1)

// insert "\n" after "w"
b.replaceSubrange(b.index(at: 11)..<b.index(at: 11), with: "\n")

// ensures layout info is cached
l.layoutText { _, _ in }
l.layoutText { _ in }

XCTAssertEqual(l.lineLayers.count, 2)
XCTAssertEqual(b.text, "0123456789w\nrap")
Expand Down

0 comments on commit ca660f4

Please sign in to comment.