Skip to content

Commit 7acb34e

Browse files
committed
Update tests to check for whitespace
1 parent ac8e50f commit 7acb34e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Tests/SourceKitLSPTests/FormattingTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ final class FormattingTests: XCTestCase {
4343
let edits = try XCTUnwrap(response)
4444
let formattedSource = apply(edits: edits, to: source)
4545

46+
XCTAssert(edits.allSatisfy { $0.newText.allSatisfy(\.isWhitespace) })
4647
XCTAssertEqual(
4748
formattedSource,
4849
"""
@@ -283,6 +284,7 @@ final class FormattingTests: XCTestCase {
283284
let edits = try XCTUnwrap(response)
284285
let formattedSource = apply(edits: edits, to: source)
285286

287+
XCTAssert(edits.allSatisfy { $0.newText.allSatisfy(\.isWhitespace) })
286288
XCTAssertEqual(
287289
formattedSource,
288290
#"""

Tests/SourceKitLSPTests/OnTypeFormattingTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ final class OnTypeFormattingTests: XCTestCase {
7575
let (_, unmarkedSource) = extractMarkers(source)
7676
let formattedSource = apply(edits: edits, to: unmarkedSource)
7777

78+
XCTAssert(edits.allSatisfy { $0.newText.allSatisfy(\.isWhitespace) })
7879
XCTAssertEqual(
7980
formattedSource,
8081
"""
8182
func foo() {
8283
if let SomeReallyLongVar = Some.More.Stuff(), let a = myfunc() {
8384
}
8485
}
85-
8686
"""
8787
)
8888
}

0 commit comments

Comments
 (0)