Skip to content

Commit 12fe639

Browse files
committed
fix: tests
1 parent 1cb2b12 commit 12fe639

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

Sources/ImageSerializationPlugin/ImageSerializationPlugin.swift

-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ import AppKit.NSImage
88
public typealias SnapImage = NSImage
99
#endif
1010

11-
// I would like to have something like this as something that represent the fileformat/identifier
12-
// but due to the limitation of @objc that can only represent have Int for RawType for enum i'ml blocked.
13-
// I need this to behave like a string
1411
public enum ImageSerializationFormat: RawRepresentable, Sendable {
1512
case png
1613
case plugins(String)

Sources/SnapshotTesting/Snapshotting/NSImage.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/// [the precision](http://zschuessler.github.io/DeltaE/learn/#toc-defining-delta-e) of the
1717
/// human eye.
1818
/// - Returns: A new diffing strategy.
19-
public static func image(precision: Float = 1, perceptualPrecision: Float = 1, imageFormat: ImageSerializationFormat) -> Diffing {
19+
public static func image(precision: Float = 1, perceptualPrecision: Float = 1, imageFormat: ImageSerializationFormat = imageFormat) -> Diffing {
2020
let imageSerializer = ImageSerializer()
2121
return .init(
2222
toData: { imageSerializer.encodeImage($0, imageFormat: imageFormat)! },
@@ -55,7 +55,7 @@
5555
/// match. 98-99% mimics
5656
/// [the precision](http://zschuessler.github.io/DeltaE/learn/#toc-defining-delta-e) of the
5757
/// human eye.
58-
public static func image(precision: Float = 1, perceptualPrecision: Float = 1, imageFormat: ImageSerializationFormat) -> Snapshotting {
58+
public static func image(precision: Float = 1, perceptualPrecision: Float = 1, imageFormat: ImageSerializationFormat = imageFormat) -> Snapshotting {
5959
return .init(
6060
pathExtension: imageFormat.rawValue,
6161
diffing: .image(precision: precision, perceptualPrecision: perceptualPrecision, imageFormat: imageFormat)

Sources/SnapshotTesting/Snapshotting/UIImage.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/// `UITraitCollection`s default value of `0.0`, the screens scale is used.
2020
/// - Returns: A new diffing strategy.
2121
public static func image(
22-
precision: Float = 1, perceptualPrecision: Float = 1, scale: CGFloat? = nil, imageFormat: ImageSerializationFormat
22+
precision: Float = 1, perceptualPrecision: Float = 1, scale: CGFloat? = nil, imageFormat: ImageSerializationFormat = imageFormat
2323
) -> Diffing {
2424
let imageScale: CGFloat
2525
if let scale = scale, scale != 0.0 {
@@ -79,7 +79,7 @@
7979
/// human eye.
8080
/// - scale: The scale of the reference image stored on disk.
8181
public static func image(
82-
precision: Float = 1, perceptualPrecision: Float = 1, scale: CGFloat? = nil, imageFormat: ImageSerializationFormat
82+
precision: Float = 1, perceptualPrecision: Float = 1, scale: CGFloat? = nil, imageFormat: ImageSerializationFormat = imageFormat
8383
) -> Snapshotting {
8484
return .init(
8585
pathExtension: imageFormat.rawValue,

0 commit comments

Comments
 (0)