@@ -21,40 +21,8 @@ final class SyntaxValidatingVisitorTests: XCTestCase {
21
21
XCTAssertNil ( _firstInvalidSyntaxPosition ( in: createSyntax ( from: input) ) )
22
22
}
23
23
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
-
42
24
/// Parses the given source into a syntax tree.
43
25
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)
58
26
return Syntax ( try ! Parser . parse ( source: source) )
59
27
}
60
28
}
0 commit comments