Closed dmitry-lyfar closed 9 months ago
Thanks @dmitry-lyfar. I'm wondering why there are differences (other than minor changes). Specifically, snapd's version of DeepUnsortedMatches
has a deepMapMatch
function as part of the implementation, and also uses validateContainerTypesAndLengths
. See for example https://github.com/snapcore/snapd/blob/89cdb0c45be1b28b161653b5164dbd74dd3ef70d/testutil/containschecker.go#L182-L192
The ErrorIs
checker only seems to have minor modifications.
Thanks @dmitry-lyfar. I'm wondering why there are differences (other than minor changes). Specifically, snapd's version of
DeepUnsortedMatches
has adeepMapMatch
function as part of the implementation, and also usesvalidateContainerTypesAndLengths
. See for example https://github.com/snapcore/snapd/blob/89cdb0c45be1b28b161653b5164dbd74dd3ef70d/testutil/containschecker.go#L182-L192The
ErrorIs
checker only seems to have minor modifications.
Thanks. Fixed, including the latest static check updates for the ErrorIs checker. Sorry, I must have failed to track the entire commit history for these changes for some reason (had them in the original PR).
This PR is made in preparation to merge the latest snapd state package changes into pebble as per the plan discussed in https://github.com/canonical/pebble/pull/259.
Both ErrorIs and DeepUnsortedMatches checkers are used by the latest state package test suites. These are cherry-picked from the snapd repository with some minor changes (fixed Pebble linter's warnings, updated license header).