Handle bundle for Image and Color
Some checks reported warnings
gitea-openium/resgen.swift/pipeline/head This commit is unstable
Some checks reported warnings
gitea-openium/resgen.swift/pipeline/head This commit is unstable
This commit is contained in:
@@ -27,7 +27,8 @@ final class ImageExtensionGeneratorTests: XCTestCase {
|
||||
extensionName: "GenImages",
|
||||
inputFilename: "myInputFilename",
|
||||
isSwiftUI: false,
|
||||
visibility: .public
|
||||
visibility: .public,
|
||||
assetBundle: .main
|
||||
)
|
||||
|
||||
// Expect
|
||||
@@ -40,11 +41,11 @@ final class ImageExtensionGeneratorTests: XCTestCase {
|
||||
extension GenImages {
|
||||
|
||||
public var image_one: UIImage {
|
||||
UIImage(named: "image_one")!
|
||||
UIImage(named: "image_one", in: Bundle.main, with: nil)!
|
||||
}
|
||||
|
||||
public var image_two: UIImage {
|
||||
UIImage(named: "image_two")!
|
||||
UIImage(named: "image_two", in: Bundle.main, with: nil)!
|
||||
}
|
||||
}
|
||||
"""
|
||||
@@ -66,7 +67,8 @@ final class ImageExtensionGeneratorTests: XCTestCase {
|
||||
extensionName: "GenImages",
|
||||
inputFilename: "myInputFilename",
|
||||
isSwiftUI: false,
|
||||
visibility: .internal
|
||||
visibility: .internal,
|
||||
assetBundle: .module
|
||||
)
|
||||
|
||||
// Expect
|
||||
@@ -79,11 +81,11 @@ final class ImageExtensionGeneratorTests: XCTestCase {
|
||||
extension GenImages {
|
||||
|
||||
internal static var image_one: UIImage {
|
||||
UIImage(named: "image_one")!
|
||||
UIImage(named: "image_one", in: Bundle.module, with: nil)!
|
||||
}
|
||||
|
||||
internal static var image_two: UIImage {
|
||||
UIImage(named: "image_two")!
|
||||
UIImage(named: "image_two", in: Bundle.module, with: nil)!
|
||||
}
|
||||
}
|
||||
"""
|
||||
@@ -105,7 +107,8 @@ final class ImageExtensionGeneratorTests: XCTestCase {
|
||||
extensionName: "GenImages",
|
||||
inputFilename: "myInputFilename",
|
||||
isSwiftUI: true,
|
||||
visibility: .public
|
||||
visibility: .public,
|
||||
assetBundle: .main
|
||||
)
|
||||
|
||||
// Expect
|
||||
@@ -118,11 +121,11 @@ final class ImageExtensionGeneratorTests: XCTestCase {
|
||||
extension GenImages {
|
||||
|
||||
public var image_one: Image {
|
||||
Image("image_one")
|
||||
Image("image_one", bundle: Bundle.main)
|
||||
}
|
||||
|
||||
public var image_two: Image {
|
||||
Image("image_two")
|
||||
Image("image_two", bundle: Bundle.main)
|
||||
}
|
||||
}
|
||||
"""
|
||||
@@ -144,7 +147,8 @@ final class ImageExtensionGeneratorTests: XCTestCase {
|
||||
extensionName: "GenImages",
|
||||
inputFilename: "myInputFilename",
|
||||
isSwiftUI: true,
|
||||
visibility: .package
|
||||
visibility: .package,
|
||||
assetBundle: .module
|
||||
)
|
||||
|
||||
// Expect
|
||||
@@ -157,11 +161,11 @@ final class ImageExtensionGeneratorTests: XCTestCase {
|
||||
extension GenImages {
|
||||
|
||||
package static var image_one: Image {
|
||||
Image("image_one")
|
||||
Image("image_one", bundle: Bundle.module)
|
||||
}
|
||||
|
||||
package static var image_two: Image {
|
||||
Image("image_two")
|
||||
Image("image_two", bundle: Bundle.module)
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
@@ -48,13 +48,14 @@ final class ParsedImageTests: XCTestCase {
|
||||
let property = parsedImage.getImageProperty(
|
||||
isStatic: false,
|
||||
isSwiftUI: false,
|
||||
visibility: .public
|
||||
visibility: .public,
|
||||
assetBundle: .main
|
||||
)
|
||||
|
||||
// Expect
|
||||
let expect = """
|
||||
public var \(imageName): UIImage {
|
||||
UIImage(named: "\(imageName)")!
|
||||
UIImage(named: "\(imageName)", in: Bundle.main, with: nil)!
|
||||
}
|
||||
"""
|
||||
|
||||
@@ -75,13 +76,14 @@ final class ParsedImageTests: XCTestCase {
|
||||
let property = parsedImage.getImageProperty(
|
||||
isStatic: true,
|
||||
isSwiftUI: false,
|
||||
visibility: .internal
|
||||
visibility: .internal,
|
||||
assetBundle: .module
|
||||
)
|
||||
|
||||
// Expect
|
||||
let expect = """
|
||||
internal static var \(imageName): UIImage {
|
||||
UIImage(named: "\(imageName)")!
|
||||
UIImage(named: "\(imageName)", in: Bundle.module, with: nil)!
|
||||
}
|
||||
"""
|
||||
|
||||
@@ -102,13 +104,14 @@ final class ParsedImageTests: XCTestCase {
|
||||
let property = parsedImage.getImageProperty(
|
||||
isStatic: false,
|
||||
isSwiftUI: true,
|
||||
visibility: .private
|
||||
visibility: .private,
|
||||
assetBundle: .main
|
||||
)
|
||||
|
||||
// Expect
|
||||
let expect = """
|
||||
private var \(imageName): Image {
|
||||
Image("\(imageName)")
|
||||
Image("\(imageName)", bundle: Bundle.main)
|
||||
}
|
||||
"""
|
||||
|
||||
@@ -129,13 +132,14 @@ final class ParsedImageTests: XCTestCase {
|
||||
let property = parsedImage.getImageProperty(
|
||||
isStatic: true,
|
||||
isSwiftUI: true,
|
||||
visibility: .package
|
||||
visibility: .package,
|
||||
assetBundle: .module
|
||||
)
|
||||
|
||||
// Expect
|
||||
let expect = """
|
||||
package static var \(imageName): Image {
|
||||
Image("\(imageName)")
|
||||
Image("\(imageName)", bundle: Bundle.module)
|
||||
}
|
||||
"""
|
||||
|
||||
|
Reference in New Issue
Block a user