feat(RES-57): Add visibility to control scope of generated code (#18)
All checks were successful
gitea-openium/resgen.swift/pipeline/head This commit looks good
All checks were successful
gitea-openium/resgen.swift/pipeline/head This commit looks good
Add visibility parameter: public, package, internal, private Impacted command: analytics, colors, fonts, images, strings, tags Reviewed-on: #18
This commit is contained in:
@@ -373,13 +373,16 @@ final class StringsFileGeneratorTests: XCTestCase {
|
||||
let sectionTwo = Section.Mock.getSectionTwo()
|
||||
|
||||
// When
|
||||
let extensionContent = StringsFileGenerator.getExtensionContent(sections: [sectionOne, sectionTwo],
|
||||
defaultLang: "fr",
|
||||
tags: ["ios", "iosonly", "notranslation"],
|
||||
staticVar: false,
|
||||
inputFilename: "myInputFilename",
|
||||
extensionName: "GenStrings",
|
||||
extensionSuffix: "strings")
|
||||
let extensionContent = StringsFileGenerator.getExtensionContent(
|
||||
sections: [sectionOne, sectionTwo],
|
||||
defaultLang: "fr",
|
||||
tags: ["ios", "iosonly", "notranslation"],
|
||||
staticVar: false,
|
||||
inputFilename: "myInputFilename",
|
||||
extensionName: "GenStrings",
|
||||
extensionSuffix: "strings",
|
||||
visibility: .internal
|
||||
)
|
||||
|
||||
// Expect
|
||||
let expect = Self.getExtensionContentExpectation(
|
||||
@@ -404,13 +407,16 @@ final class StringsFileGeneratorTests: XCTestCase {
|
||||
)
|
||||
|
||||
// When
|
||||
let extensionContent = StringsFileGenerator.getExtensionContent(sections: [sectionOne, sectionTwo],
|
||||
defaultLang: "fr",
|
||||
tags: ["ios", "iosonly", "notranslation"],
|
||||
staticVar: false,
|
||||
inputFilename: "myInputFilename",
|
||||
extensionName: "GenStrings",
|
||||
extensionSuffix: "strings")
|
||||
let extensionContent = StringsFileGenerator.getExtensionContent(
|
||||
sections: [sectionOne, sectionTwo],
|
||||
defaultLang: "fr",
|
||||
tags: ["ios", "iosonly", "notranslation"],
|
||||
staticVar: false,
|
||||
inputFilename: "myInputFilename",
|
||||
extensionName: "GenStrings",
|
||||
extensionSuffix: "strings",
|
||||
visibility: .public
|
||||
)
|
||||
|
||||
// Expect
|
||||
let expect = Self.getExtensionContentExpectation(
|
||||
@@ -419,6 +425,7 @@ final class StringsFileGeneratorTests: XCTestCase {
|
||||
s1DefTwoComment: "This is a comment",
|
||||
s2DefOneComment: "This is a comment",
|
||||
s2DefTwoComment: "This is a comment",
|
||||
visibility: .public
|
||||
)
|
||||
|
||||
if extensionContent != expect {
|
||||
@@ -434,17 +441,21 @@ final class StringsFileGeneratorTests: XCTestCase {
|
||||
let sectionTwo = Section.Mock.getSectionTwo()
|
||||
|
||||
// When
|
||||
let extensionContent = StringsFileGenerator.getExtensionContent(sections: [sectionOne, sectionTwo],
|
||||
defaultLang: "fr",
|
||||
tags: ["ios", "iosonly", "notranslation"],
|
||||
staticVar: true,
|
||||
inputFilename: "myInputFilename",
|
||||
extensionName: "GenStrings",
|
||||
extensionSuffix: "strings")
|
||||
let extensionContent = StringsFileGenerator.getExtensionContent(
|
||||
sections: [sectionOne, sectionTwo],
|
||||
defaultLang: "fr",
|
||||
tags: ["ios", "iosonly", "notranslation"],
|
||||
staticVar: true,
|
||||
inputFilename: "myInputFilename",
|
||||
extensionName: "GenStrings",
|
||||
extensionSuffix: "strings",
|
||||
visibility: .package
|
||||
)
|
||||
|
||||
// Expect
|
||||
let expect = Self.getExtensionContentExpectation(
|
||||
staticVar: true
|
||||
staticVar: true,
|
||||
visibility: .package
|
||||
)
|
||||
|
||||
if extensionContent != expect {
|
||||
@@ -465,13 +476,16 @@ final class StringsFileGeneratorTests: XCTestCase {
|
||||
)
|
||||
|
||||
// When
|
||||
let extensionContent = StringsFileGenerator.getExtensionContent(sections: [sectionOne, sectionTwo],
|
||||
defaultLang: "fr",
|
||||
tags: ["ios", "iosonly", "notranslation"],
|
||||
staticVar: true,
|
||||
inputFilename: "myInputFilename",
|
||||
extensionName: "GenStrings",
|
||||
extensionSuffix: "strings")
|
||||
let extensionContent = StringsFileGenerator.getExtensionContent(
|
||||
sections: [sectionOne, sectionTwo],
|
||||
defaultLang: "fr",
|
||||
tags: ["ios", "iosonly", "notranslation"],
|
||||
staticVar: true,
|
||||
inputFilename: "myInputFilename",
|
||||
extensionName: "GenStrings",
|
||||
extensionSuffix: "strings",
|
||||
visibility: .internal
|
||||
)
|
||||
|
||||
// Expect
|
||||
let expect = Self.getExtensionContentExpectation(
|
||||
@@ -480,6 +494,7 @@ final class StringsFileGeneratorTests: XCTestCase {
|
||||
s1DefTwoComment: "This is a comment",
|
||||
s2DefOneComment: "This is a comment",
|
||||
s2DefTwoComment: "This is a comment",
|
||||
visibility: .internal
|
||||
)
|
||||
|
||||
if extensionContent != expect {
|
||||
|
Reference in New Issue
Block a user