Skip to content

[5.5] Fix new package XCTest file formatting and include throws keyword #3449

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

stmontgomery
Copy link
Contributor

Motivation: Fix formatting of the XCTest source file in newly init'ed packages, and include the
throws keyword on the example XCTest method as a convenience to users and to promote use of throwing
test methods in XCTests.

Changes:

  • Fix a bug in the formatting of XCTest source files in InitPackage, where the closing """ string
    terminator was outdented one level too far, which resulted in the file contents being indented unnecessarily.
  • Include the throws keyword on func testExample() in the new Library type package template.
  • Modify an existing test to validate these improvements.

rdar://77209458
rdar://77209464

…iftlang#3448)

Motivation: Fix formatting of the XCTest source file in newly `init`'ed packages, and include the
`throws` keyword on the example XCTest method as a convenience to users and to promote use of throwing
test methods in XCTests.

Changes:
- Fix a bug in the formatting of XCTest source files in `InitPackage`, where the closing `"""` string
  terminator was outdented one level too far, which resulted in the file contents being indented unnecessarily.
- Include the `throws` keyword on `func testExample()` in the new Library type package template.
- Modify an existing test to validate these improvements.

rdar://77209458
rdar://77209464
@stmontgomery
Copy link
Contributor Author

@swift-ci please test

@stmontgomery stmontgomery changed the title [5.5 Cherry-pick] Fix new package XCTest file formatting and include throws keyword [5.5] Fix new package XCTest file formatting and include throws keyword Apr 27, 2021
@tomerd tomerd added the 5.5 label Apr 27, 2021
@stmontgomery stmontgomery merged commit f52b6f5 into swiftlang:release/5.5 Apr 27, 2021
@stmontgomery stmontgomery deleted the test-file-template-fixes-77209458-77209464-5.5 branch April 27, 2021 22:37
@tomerd
Copy link
Contributor

tomerd commented Apr 27, 2021

reviewed in #3448

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants