Skip to content

Commit 298d39b

Browse files
Corrects trimming of log suffixes
1 parent c00bec4 commit 298d39b

File tree

4 files changed

+656
-2
lines changed

4 files changed

+656
-2
lines changed

Sources/App/Controllers/OutputController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ private extension String {
6767
return self
6868
}
6969

70-
return String(self[...range.lowerBound])
70+
return String(self[..<range.lowerBound])
7171
}
7272
}

Tests/AppTests/Inputs/Input+Custom.swift

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,31 @@ enum Input {
7979
"<NSLayoutConstraint:0x608000696990 V:[ListViewItemLabel...]-(7)-[ListViewItemLabel...] (active, names: ListViewItemLabel...:0x7f950028efe0, ListViewItemLabel...:0x7f950028e5b0 )>"
8080
)
8181
"""
82+
83+
static let custom9 = """
84+
Unable to simultaneously satisfy constraints.
85+
Probably at least one of the constraints in the following list is one you don't want.
86+
Try this:
87+
(1) look at each constraint and try to figure out which you don't expect;
88+
(2) find the code that added the unwanted constraint or constraints and fix it.
89+
(
90+
"<NSLayoutConstraint:0x7f83b9a05b10 UIImageView:0x7f83b8171210.width == 40 (active)>",
91+
"<NSLayoutConstraint:0x7f83b9a08d40 UIImageView:0x7f83b9a08580.width == 60 (active)>",
92+
"<NSLayoutConstraint:0x7f83b9a099d0 H:|-(15)-[UIImageView:0x7f83b8171210] (active, names: '|':UITableViewCellContentView:0x7f83b8171010 )>",
93+
"<NSLayoutConstraint:0x7f83b9a09b50 H:[UIImageView:0x7f83b8171210]-(8)-[UIStackView:0x7f83b9a05c70] (active)>",
94+
"<NSLayoutConstraint:0x7f83b9a0a1b0 H:[UIImageView:0x7f83b9a08580]-(5)-| (active, names: '|':UITableViewCellContentView:0x7f83b8171010 )>",
95+
"<NSLayoutConstraint:0x7f83b9a0a330 H:[UIStackView:0x7f83b9a05c70]-(8)-[UIImageView:0x7f83b9a08580] (active)>",
96+
"<NSLayoutConstraint:0x7f83b8174e70 'UISV-alignment' UILabel:0x7f83b9a05e80'Set lunch'.leading == UILabel:0x7f83b9a06c70'Added at 10:26'.leading (active)>",
97+
"<NSLayoutConstraint:0x7f83b85cf8e0 'UISV-alignment' UILabel:0x7f83b9a05e80'Set lunch'.trailing == UILabel:0x7f83b9a06c70'Added at 10:26'.trailing (active)>",
98+
"<NSLayoutConstraint:0x7f83b83fafa0 'UISV-canvas-connection' UIStackView:0x7f83b9a05c70.leading == UILabel:0x7f83b9a05e80'Set lunch'.leading (active)>",
99+
"<NSLayoutConstraint:0x7f83b9b005c0 'UISV-canvas-connection' H:[UILabel:0x7f83b9a05e80'Set lunch']-(0)-| (active, names: '|':UIStackView:0x7f83b9a05c70 )>",
100+
"<NSLayoutConstraint:0x7f83b9a127e0 'UIView-Encapsulated-Layout-Width' UITableViewCellContentView:0x7f83b8171010.width == 94.3333 (active)>"
101+
)
102+
103+
Will attempt to recover by breaking constraint
104+
<NSLayoutConstraint:0x7f83b85cf8e0 'UISV-alignment' UILabel:0x7f83b9a05e80'Set lunch'.trailing == UILabel:0x7f83b9a06c70'Added at 10:26'.trailing (active)>
105+
106+
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
107+
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
108+
"""
82109
}

Tests/AppTests/ViewTests.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ class ViewTests: XCTestCase {
5151
Input.custom5,
5252
Input.custom6,
5353
Input.custom7,
54-
Input.custom8
54+
Input.custom8,
55+
Input.custom9
5556
]
5657

5758
for input in inputs {

0 commit comments

Comments
 (0)