Skip to content

Commit b25b4d8

Browse files
committed
Remove Invalid Syntax Tests
The new parser no longer instantiates UnknownSyntax nodes, so this test isn't actually ever going to catch anything.
1 parent c0a2778 commit b25b4d8

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

Tests/SwiftFormatTests/SyntaxValidatingVisitorTests.swift

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -21,40 +21,8 @@ final class SyntaxValidatingVisitorTests: XCTestCase {
2121
XCTAssertNil(_firstInvalidSyntaxPosition(in: createSyntax(from: input)))
2222
}
2323

24-
func testInvalidSyntax() {
25-
var input =
26-
"""
27-
class {TemplateName} {
28-
var bar = 0
29-
}
30-
"""
31-
assertInvalidSyntax(in: input, atLine: 1, column: 7)
32-
33-
input =
34-
"""
35-
switch a {
36-
@unknown what_is_this default: break
37-
}
38-
"""
39-
assertInvalidSyntax(in: input, atLine: 1, column: 1)
40-
}
41-
4224
/// Parses the given source into a syntax tree.
4325
private func createSyntax(from source: String) -> Syntax {
44-
}
45-
46-
/// Asserts that `SyntaxValidatingVisitor` finds invalid syntax in the given source code at the
47-
/// given line and column.
48-
private func assertInvalidSyntax(
49-
in source: String, atLine: Int, column: Int, file: StaticString = #file, line: UInt = #line
50-
) {
51-
guard let position = _firstInvalidSyntaxPosition(in: createSyntax(from: source)) else {
52-
XCTFail("No invalid syntax was found", file: file, line: line)
53-
return
54-
}
55-
let location = SourceLocationConverter(file: "", source: source).location(for: position)
56-
XCTAssertEqual(location.line, atLine, file: file, line: line)
57-
XCTAssertEqual(location.column, column, file: file, line: line)
5826
return Syntax(try! Parser.parse(source: source))
5927
}
6028
}

0 commit comments

Comments
 (0)