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

assert: Fix Subset/NotSubset when map is missing keys from the subset #1261

Commits on Sep 13, 2022

  1. Fix Subset/NotSubset when map is missing keys from the subset

    `MapIndex` returns a zero `reflect.Value` if the map value does not
    exist. This now aligns more closely with `InDeltaMapValues` by
    checking `reflect/Value.IsValid`.
    
    The use of `recover()` was hiding this error by setting the result of
    the test to be "false" despite the test suite passing. This led to
    flapping tests where they would succeed if the panic occurred on a
    missing key before comparing key values that didn't match!
    
    I've ensured the test suite now asserts on the expected error message
    and added another example where the subset has keys not found on the
    map under test.
    danielwhite committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    c916d80 View commit details
    Browse the repository at this point in the history