New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unit tests are failing with DTFoundation version 1.7.18 #22
Comments
It would be helpful if you could tell me specifically what broke. |
Specifically, the problem is in func unwrapRootSequence(_ sequence: [AnyObject]) -> Data?
{
guard sequence.count==2,
let OID = sequence[0] as? String, OID == "1.2.840.113549.1.7.2",
let containedSequence = sequence[1] as? [AnyObject], containedSequence.count == 1,
let actualSequence = containedSequence[0] as? [AnyObject], actualSequence.count > 2,
let dataSequence = actualSequence[2] as? [AnyObject]
else
{
return nil
}
return unwrapSignedDataSequence(dataSequence)
} The guard statement fails in line 45, where we try to unwrap second element of the sequence to It seems the type changed to Dictionary with the new version. I suspect this commit is the cause for this change: Cocoanetics/DTFoundation@2bf3efc |
Is that in the Kvitto unit tests? The context was missing, now there is an additional container that needs to be ignored |
@odrobnik yes, in Kvitto all unit tests that are trying to initialize |
@jlajlar I updated and re-released 1.0.6. I've updated the code to handle both cases (old parsing style and new parsing that includes context containers). I've tested with both versions of DTFoundation.. |
Hey,
We recently updated swift packages in our app and with the updates came DTFoundation 1.7.18. In our tests, receipt parsing stopped working in our app with combination of Kvitto (version 1.0.6) and DTFoundation (version 1.7.18). On older version 1.7.17 receipts are parsed successfully and unit tests are all green as well.
The text was updated successfully, but these errors were encountered: