Skip to content

Don't error on mismatches when actual value is a Datomic EntityMap#232

Merged
philomates merged 3 commits intomasterfrom
mismatch-datomic-entity-map
Jan 27, 2026
Merged

Don't error on mismatches when actual value is a Datomic EntityMap#232
philomates merged 3 commits intomasterfrom
mismatch-datomic-entity-map

Conversation

@philomates
Copy link
Copy Markdown
Collaborator

When trying to match for Datomic EntityMap values (or other values that only partially implement clojure.lang.Associative), mismatches will result in errors:

(is (match? {:x 1} some-datomic-entity-map))
;; Receiver class datomic.api.EntityMap does not define or inherit an implementation of the resolved method 'abstract clojure.lang.IPersistentCollection cons(java.lang.Object)' of interface clojure.lang.IPersistentCollection.

This change gets around this by first converting the actual to a map so assoc'ing mismatch info is possible.

Note: this change will mean that in specific cases the data-structure returned by the library will not have the exact same type as the provided actual value. The chances that this causes confusion are minimal (probably only if you interact with data coming back from the library instead of just test report output).

@philomates philomates force-pushed the mismatch-datomic-entity-map branch from c995f43 to 663f49b Compare January 22, 2026 14:49
@philomates philomates merged commit 3d88fc2 into master Jan 27, 2026
3 of 5 checks passed
@philomates philomates deleted the mismatch-datomic-entity-map branch January 27, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant