feat(RES-58): Add new parameter "bundle" (#19)
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 bundle parameter to define if resource should be load from Bundle.main (app) or Bundle.module (SPM package) Reviewed-on: #19
This commit is contained in:
@@ -377,16 +377,17 @@ final class StringsFileGeneratorTests: XCTestCase {
|
||||
sections: [sectionOne, sectionTwo],
|
||||
defaultLang: "fr",
|
||||
tags: ["ios", "iosonly", "notranslation"],
|
||||
staticVar: false,
|
||||
isStatic: false,
|
||||
inputFilename: "myInputFilename",
|
||||
extensionName: "GenStrings",
|
||||
extensionSuffix: "strings",
|
||||
visibility: .internal
|
||||
visibility: .internal,
|
||||
assetBundle: .main
|
||||
)
|
||||
|
||||
// Expect
|
||||
let expect = Self.getExtensionContentExpectation(
|
||||
staticVar: false
|
||||
isStatic: false
|
||||
)
|
||||
|
||||
if extensionContent != expect {
|
||||
@@ -411,16 +412,17 @@ final class StringsFileGeneratorTests: XCTestCase {
|
||||
sections: [sectionOne, sectionTwo],
|
||||
defaultLang: "fr",
|
||||
tags: ["ios", "iosonly", "notranslation"],
|
||||
staticVar: false,
|
||||
isStatic: false,
|
||||
inputFilename: "myInputFilename",
|
||||
extensionName: "GenStrings",
|
||||
extensionSuffix: "strings",
|
||||
visibility: .public
|
||||
visibility: .public,
|
||||
assetBundle: .main
|
||||
)
|
||||
|
||||
// Expect
|
||||
let expect = Self.getExtensionContentExpectation(
|
||||
staticVar: false,
|
||||
isStatic: false,
|
||||
s1DefOneComment: "This is a comment",
|
||||
s1DefTwoComment: "This is a comment",
|
||||
s2DefOneComment: "This is a comment",
|
||||
@@ -435,7 +437,7 @@ final class StringsFileGeneratorTests: XCTestCase {
|
||||
}
|
||||
|
||||
// MARK: - Extension Content Static
|
||||
func testGeneratedExtensionContentWithStaticVar() {
|
||||
func testGeneratedExtensionContentWithIsStatic() {
|
||||
// Given
|
||||
let sectionOne = Section.Mock.getSectionOne()
|
||||
let sectionTwo = Section.Mock.getSectionTwo()
|
||||
@@ -445,17 +447,19 @@ final class StringsFileGeneratorTests: XCTestCase {
|
||||
sections: [sectionOne, sectionTwo],
|
||||
defaultLang: "fr",
|
||||
tags: ["ios", "iosonly", "notranslation"],
|
||||
staticVar: true,
|
||||
isStatic: true,
|
||||
inputFilename: "myInputFilename",
|
||||
extensionName: "GenStrings",
|
||||
extensionSuffix: "strings",
|
||||
visibility: .package
|
||||
visibility: .package,
|
||||
assetBundle: .module
|
||||
)
|
||||
|
||||
// Expect
|
||||
let expect = Self.getExtensionContentExpectation(
|
||||
staticVar: true,
|
||||
visibility: .package
|
||||
isStatic: true,
|
||||
visibility: .package,
|
||||
assetBundle: .module
|
||||
)
|
||||
|
||||
if extensionContent != expect {
|
||||
@@ -464,7 +468,7 @@ final class StringsFileGeneratorTests: XCTestCase {
|
||||
XCTAssertEqual(extensionContent.adaptForXCTest(), expect.adaptForXCTest())
|
||||
}
|
||||
|
||||
func testGeneratedExtensionContentWithStaticVarWithComment() {
|
||||
func testGeneratedExtensionContentWithIsStaticWithComment() {
|
||||
// Given
|
||||
let sectionOne = Section.Mock.getSectionOne(
|
||||
defOneComment: "This is a comment",
|
||||
@@ -480,21 +484,23 @@ final class StringsFileGeneratorTests: XCTestCase {
|
||||
sections: [sectionOne, sectionTwo],
|
||||
defaultLang: "fr",
|
||||
tags: ["ios", "iosonly", "notranslation"],
|
||||
staticVar: true,
|
||||
isStatic: true,
|
||||
inputFilename: "myInputFilename",
|
||||
extensionName: "GenStrings",
|
||||
extensionSuffix: "strings",
|
||||
visibility: .internal
|
||||
visibility: .internal,
|
||||
assetBundle: .module
|
||||
)
|
||||
|
||||
// Expect
|
||||
let expect = Self.getExtensionContentExpectation(
|
||||
staticVar: true,
|
||||
isStatic: true,
|
||||
s1DefOneComment: "This is a comment",
|
||||
s1DefTwoComment: "This is a comment",
|
||||
s2DefOneComment: "This is a comment",
|
||||
s2DefTwoComment: "This is a comment",
|
||||
visibility: .internal
|
||||
visibility: .internal,
|
||||
assetBundle: .module
|
||||
)
|
||||
|
||||
if extensionContent != expect {
|
||||
|
Reference in New Issue
Block a user