Skip to content

Commit db2b4cb

Browse files
authored
Merge pull request #2321 from ahoppen/all-whitespace
Update formatting test so we can check that only whitespace edits are produced
2 parents 320a356 + 909bf09 commit db2b4cb

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

Tests/SourceKitLSPTests/FormattingTests.swift

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -256,14 +256,14 @@ final class FormattingTests: XCTestCase {
256256
_ = [
257257
Node(
258258
documentation: """
259-
A
260-
B
261-
C
259+
Some great documentation
260+
of an amazing
261+
syntax node
262262
""",
263263
children: [
264264
Child(
265265
documentation: """
266-
A
266+
The one and only child
267267
\#("")
268268
"""
269269
)
@@ -283,21 +283,22 @@ final class FormattingTests: XCTestCase {
283283

284284
let edits = try XCTUnwrap(response)
285285
let formattedSource = apply(edits: edits, to: source)
286+
XCTAssert(edits.allSatisfy { $0.newText.allSatisfy(\.isWhitespace) })
286287

287288
XCTAssertEqual(
288289
formattedSource,
289290
#"""
290291
_ = [
291292
Node(
292293
documentation: """
293-
A
294-
B
295-
C
294+
Some great documentation
295+
of an amazing
296+
syntax node
296297
""",
297298
children: [
298299
Child(
299300
documentation: """
300-
A
301+
The one and only child
301302
302303
"""
303304
)

0 commit comments

Comments
 (0)