-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug with new dominates? method and related 11.0 features (#55)
* Fix bug in new dominates? and related new 0.11.0 features * Bump version -> 0.11.1 * Lint fix.
- Loading branch information
Showing
10 changed files
with
141 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
(ns methodical.impl.multifn.standard-test | ||
(:require [clojure.test :as t] | ||
[methodical.core :as m] | ||
[methodical.impl.multifn.standard :as standard])) | ||
|
||
(t/deftest standard-effective-method-dispatch-value-test | ||
(t/testing "standard-effective-method should return a method with the correct ^:dispatch-value metadata" | ||
(derive ::parrot ::bird) | ||
(derive ::parakeet ::parrot) | ||
(derive ::budgie ::parakeet) | ||
(derive ::love-bird ::parrot) | ||
(let [combo (m/thread-last-method-combination) | ||
dispatcher (m/multi-default-dispatcher :type) | ||
method-table (-> (m/standard-method-table) | ||
(m/add-primary-method :default (fn [_])) | ||
(m/add-primary-method ::parakeet (fn [_])) | ||
(m/add-aux-method :after ::bird (fn [_])) | ||
(m/add-aux-method :after ::parrot (fn [_])))] | ||
(doseq [[dv expected] {::dog :default | ||
::bird ::bird | ||
::parrot ::parrot | ||
::parakeet ::parakeet | ||
::budgie ::parakeet | ||
::love-bird ::parrot}] | ||
(t/testing dv | ||
(t/is (= {:dispatch-value expected} | ||
(meta (standard/standard-effective-method combo dispatcher method-table dv))))))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters