Skip to content

Commit 94f8fa4

Browse files
author
Nathan Hawes
committed
[test] Update PD5LoadingTests.swift for a parser fix that suppressed a diagnostic it was checking for.
The test parses the code below and checks for a "expected ')' in expression list" diagnostic: ``` import PackageDescription let package = Package( name: "Trivial", targets: [ .target( name: "foo", dependencies: []), ) ``` Prior to the parser fix the invalid collection literal failed to parse but the error status wasn't propagated up to the containing argument list parsing code, so it produced an additional (and undesirable) missing right token diagnostic that this test was checking for. /tmp/t.swift:9:1: error: expected expression in container literal ) ^ /tmp/t.swift:9:2: error: expected ')' in expression list ) ^ /tmp/t.swift:2:22: note: to match this opening '(' let package = Package( ^ Afer the parser fix in swiftlang/swift#30187, we only report the first container literal error and suppress the rest: /tmp/t.swift:9:1: error: expected expression in container literal ) ^
1 parent eec7a3f commit 94f8fa4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Tests/PackageLoadingTests/PD5LoadingTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ class PackageDescription5LoadingTests: PackageDescriptionLoadingTests {
328328
packageKind: .local
329329
)
330330
} catch ManifestParseError.invalidManifestFormat(let error, let diagnosticFile) {
331-
XCTAssertMatch(error, .contains("expected \')\' in expression list"))
331+
XCTAssertMatch(error, .contains("expected expression in container literal"))
332332
let contents = try localFileSystem.readFileContents(diagnosticFile!)
333333
XCTAssertNotNil(contents)
334334
}

0 commit comments

Comments
 (0)