Skip to content
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

feat(testutil): add ErrorIs and DeepUnsortedMatches checkers #331

Merged

Commits on Nov 16, 2023

  1. testutil: add ErrorIs test checker

    Signed-off-by: Miguel Pires <[email protected]>
    miguelpires authored and dmitry-lyfar committed Nov 16, 2023
    Configuration menu
    Copy the full SHA
    267d2d0 View commit details
    Browse the repository at this point in the history
  2. testutil: add DeepUnsortedMatches Checker

    Adds a Checker to test that two containers have the same elements (duplicates must occur in the same number) but possibly in different orders.
    miguelpires authored and dmitry-lyfar committed Nov 16, 2023
    Configuration menu
    Copy the full SHA
    ab2bc69 View commit details
    Browse the repository at this point in the history

Commits on Nov 20, 2023

  1. testutil: compare unsorted containers nested in maps

    Only top-level containers were matched in an unsorted way and maps
    were compared with reflect.DeepEqual. Now map values are also "unsorted
    matched" so values like map[string][]string can be compared regardless
    of order even with nesting. Note that containers nested in slices or
    arrays are still compared in the normal way.
    
    Signed-off-by: Miguel Pires <[email protected]>
    (cherry picked from commit 1af63c24476cb0a7409d499a76c8b5a59c04ca9c)
    miguelpires authored and dmitry-lyfar committed Nov 20, 2023
    Configuration menu
    Copy the full SHA
    073843c View commit details
    Browse the repository at this point in the history
  2. testutil: remove unneeded fmt.Sprintf

    As suggested by staticcheck.io
    
    (cherry picked from commit 4eff3617d9d1152874db2a2f8b6d90678f59c6b1)
    mvo5 authored and dmitry-lyfar committed Nov 20, 2023
    Configuration menu
    Copy the full SHA
    3ad354f View commit details
    Browse the repository at this point in the history