Skip to content

Improve :mismatch/detail for missing keys #107

Open
@dchelimsky

Description

@dchelimsky

;; TODO - file issue in matcher-combinators to improve :mismatch/detail for missing keys

(match {:a 1} {:b 2})

;; produces
{:match/result :mismatch,
 :mismatch/detail {:b 2, :a {:expected 1}}}

The :expected 1 without actual there is meant to be interpreted to mean the key is not present, but that could be more explicit. Something like this, for example (though certainly not the only solution):

{:match/result :mismatch,
 :mismatch/detail {:value {:b 2}, :missing-keys [:a]}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions