mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
27 lines
569 B
Swift
27 lines
569 B
Swift
// RUN: %target-run-simple-swift
|
|
// REQUIRES: executable_test
|
|
// REQUIRES: OS=macosx
|
|
// REQUIRES: objc_interop
|
|
|
|
import Foundation
|
|
import StdlibUnittest
|
|
import SwiftSyntax
|
|
|
|
var ParseFile = TestSuite("ParseFile")
|
|
|
|
struct Foo {
|
|
public let x: Int
|
|
private(set) var y: [Bool]
|
|
}
|
|
|
|
ParseFile.test("ParseSingleFile") {
|
|
let currentFile = URL(fileURLWithPath: #file)
|
|
expectDoesNotThrow({
|
|
let currentFileContents = try String(contentsOf: currentFile)
|
|
let parsed = try Syntax.parse(currentFile)
|
|
expectEqual("\(parsed)", currentFileContents)
|
|
})
|
|
}
|
|
|
|
runAllTests()
|