Add new tag generation
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit
This commit is contained in:
@ -13,28 +13,28 @@ import ToolCore
|
||||
|
||||
final class TagsGeneratorTests: XCTestCase {
|
||||
|
||||
private func getDefinition(name: String, lang: String, tags: [String]) -> Definition {
|
||||
let definition = Definition(name: name)
|
||||
private func getDefinition(name: String, lang: String, tags: [String]) -> TagDefinition {
|
||||
let definition = TagDefinition(title: name)
|
||||
definition.tags = tags
|
||||
definition.translations = [lang: "Some translation"]
|
||||
// definition.translations = [lang: "Some translation"]
|
||||
return definition
|
||||
}
|
||||
|
||||
func testGeneratedExtensionContent() {
|
||||
// Given
|
||||
let sectionOne = Section(name: "section_one")
|
||||
let sectionOne = TagSection(name: "section_one")
|
||||
sectionOne.definitions = [
|
||||
getDefinition(name: "s1_def_one", lang: "ium", tags: ["ios","iosonly"]),
|
||||
getDefinition(name: "s1_def_two", lang: "ium", tags: ["ios","iosonly"]),
|
||||
]
|
||||
|
||||
let sectionTwo = Section(name: "section_two")
|
||||
let sectionTwo = TagSection(name: "section_two")
|
||||
sectionTwo.definitions = [
|
||||
getDefinition(name: "s2_def_one", lang: "ium", tags: ["ios","iosonly"]),
|
||||
getDefinition(name: "s2_def_two", lang: "ium", tags: ["droid","droidonly"])
|
||||
]
|
||||
|
||||
let sectionThree = Section(name: "section_three")
|
||||
let sectionThree = TagSection(name: "section_three")
|
||||
sectionThree.definitions = [
|
||||
getDefinition(name: "s3_def_one", lang: "ium", tags: ["droid","droidonly"]),
|
||||
getDefinition(name: "s3_def_two", lang: "ium", tags: ["droid","droidonly"])
|
||||
@ -42,7 +42,7 @@ final class TagsGeneratorTests: XCTestCase {
|
||||
|
||||
// When
|
||||
let extensionContent = TagsGenerator.getExtensionContent(sections: [sectionOne, sectionTwo, sectionThree],
|
||||
lang: "ium",
|
||||
targets: [Tags.TargetType.firebase],
|
||||
tags: ["ios", "iosonly"],
|
||||
staticVar: false,
|
||||
extensionName: "GenTags")
|
||||
|
Reference in New Issue
Block a user