For those who have just stumbled upon this thread, my situation is that I am trying to run the code above in the first post to verify that the colors that I get from an asset catalog are being correctly converted into SwiftUI Color instances so that frequently used custom colors can be more easily managed. This conversion is done automatically using a Swift package plugin that generates the accessors automatically based on the asset catalogs. The persistent issue that I've been having for a longer period of time as I am writing this is that neither XCTest nor Swift Testing find the two instances equal because one is instantiated using the initializer that takes three Double instances (one red, one green, and one blue) and the other is instantiated using the initializer that specifies the color as it appears in an asset catalog.
These tests have been consistently failing as a result and are marked as being known issues. My updated version of this project uses Swift Testing for these tests, though the issue occurs regardless of the testing framework in use. I have thought about how it may not be necessary to do as deep as comparison. I could make sure that the correct symbols are being generated by filling in manually what I would expect from the generated code. I recently contacted Apple Developer Technical Support and am working with them to resolve my issue. I will occasionally post new updates on the status of my issue.
Topic:
App & System Services
SubTopic:
General
Tags: