swiftlang / swift-format

Formatting technology for Swift source code
Apache License 2.0
2.47k stars 227 forks source link

Unit tests for swift-format CLI tool and for Plugins #611

Open natikgadzhi opened 1 year ago

natikgadzhi commented 1 year ago

Currently, swift-format test suite covers Rules and PrettyPrint. Several components are not covered:

Disclaimer: my understanding and knowledge are very high-level and basic still, I'm only diving in.

I think with some guidance, we could split these components up into smaller chunks, and each of those chunk-unit-test-issues could be a great good-first-issue for beginners.

UPD: Stumbled at this when I was looking to add tests for executable generate-pipeline target: https://forums.swift.org/t/argumentparser-and-xctest/34523

BrianHenryIE commented 1 year ago

I introduced a test for the plugin in #608: PluginRunTests.swift. I expect there is some Gherkin style BDD library that could be used to write the test in a nicer way, but I've never used one in Swift and I don't know the policy on introducing third party libraries to the project (I notice all dependencies currently are Apple projects).

ahoppen commented 5 months ago

Tracked in Apple’s issue tracker as rdar://126948360