Add new tag generation
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit

This commit is contained in:
2023-12-05 16:56:44 +01:00
parent fa5bf192e8
commit ce274219fc
8 changed files with 493 additions and 98 deletions

View File

@ -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")