Created
April 30, 2021 10:49
-
-
Save anzfactory/c33b45917debb4c3d5635d2356ac132c to your computer and use it in GitHub Desktop.
テストケースを自動生成させるためのテンプレート
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen | |
// | |
{% macro allValuesBlock assets prefix %} | |
{% for asset in assets %} | |
{% if asset.items %} | |
{% set newPrefix %}{{prefix}}{{asset.name|swiftIdentifier:"pretty"|escapeReservedKeywords}}.{% endset %} | |
{% call allValuesBlock asset.items newPrefix %} | |
{% elif asset.type != "group" %} | |
_ = Asset.{{prefix}}{{asset.name|swiftIdentifier:"pretty"|lowerFirstWord}}.{{asset.type}} | |
{% endif %} | |
{% endfor %} | |
{% endmacro %} | |
import XCTest | |
@testable import YoutProjectName | |
class AssetTests: XCTestCase { | |
func testAssetsAreAvailable() throws { | |
{% for catalog in catalogs %} | |
{% call allValuesBlock catalog.assets "" %} | |
{% endfor %} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment