Move compound-ios package into the project.

This commit is contained in:
Doug
2025-09-28 15:19:46 +01:00
committed by Doug
parent 0519ef9c9b
commit aeaac90239
80 changed files with 3658 additions and 25 deletions

View File

@@ -0,0 +1,46 @@
// swiftlint:disable all
// swiftformat:disable all
import XCTest
@testable import Compound
{% if argument.mainTarget %}
@testable import {{ argument.mainTarget }}
{% endif %}
{% for import in argument.imports %}
{% if import != "last" %}
import {{ import }}
{% endif %}
{% endfor %}
{% for import in argument.testableImports %}
{% if import != "last" %}
@testable import {{ import }}
{% endif %}
{% endfor %}
extension PreviewTests {
{% if argument.file %}
private var file: StaticString { .init(stringLiteral: "{{ argument.file }}") }
{% endif %}
// MARK: - PreviewProvider
{% for type in types.types where (type.implements.TestablePreview or type.based.TestablePreview or type|annotated:"TestablePreview") and type.name != "TestablePreview" %}
func test{{ type.name|replace:"_Previews", "" }}() async throws {
for (index, preview) in {{ type.name }}._allPreviews.enumerated() {
try await assertSnapshots(matching: preview, step: index)
}
}
{%- if not forloop.last %}
{% endif %}
{% endfor %}
{% if argument.previewsMacros %}
// MARK: - Macros
{{ argument.previewsMacros }}
{% endif %}
}
// swiftlint:enable all
// swiftformat:enable all