This file contains hidden or 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
| (testing "describe syntax" | |
| (describe "single assertion" | |
| (= (+ 1 1) 2)) | |
| (context "many assertions" | |
| (describe "plus" | |
| (= (+ 1 1) 2) | |
| "minus" | |
| (= (- 2 1) 1) | |
| "divide" |
This file contains hidden or 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
| {:type :context, | |
| :doc describe syntax, | |
| :tests ({:type :expects, | |
| :doc single assertion, | |
| :tests ({:type :expect, | |
| :expectations [(fn [] (= (+ 1 1) 2))]})})} |
This file contains hidden or 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
| (ns bktree) | |
| (defn root [distance-fn] {:distance-fn distance-fn :children {}}) | |
| (defn new-node [term] {:term term :children {}}) | |
| (defn insert | |
| ([element node] | |
| (insert element node (:distance-fn node))) | |
| ([element node distance-fn] |
This file contains hidden or 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
| (ns bktree) | |
| (defn root [distance-fn] {:distance-fn distance-fn :children {}}) | |
| (defn new-node [term] {:term term :children {}}) | |
| (defn insert | |
| ([element node] | |
| (insert element node (:distance-fn node))) | |
| ([element node distance-fn] |
This file contains hidden or 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
| (ns bktree) | |
| (defn root [distance-fn] {:distance-fn distance-fn :children {}}) | |
| (defn new-node [term] {:term term :children {}}) | |
| (defn insert | |
| ([element node] | |
| (insert element node (:distance-fn node))) | |
| ([element node distance-fn] |
This file contains hidden or 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
| (ns bktree) | |
| (defn root [distance-fn] {:distance-fn distance-fn :children {} :matches []}) | |
| (defn new-node [term] {:term term :children {} :matches []}) | |
| (defn insert | |
| ([element node] | |
| (insert element node (:distance-fn node))) | |
| ([element node distance-fn] |
This file contains hidden or 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
| (ns bktree) | |
| (defn root [distance-fn] {:distance-fn distance-fn :children {} :matches []}) | |
| (defn new-node [term] {:term term :children {} :matches []}) | |
| (defn insert | |
| ([element node] | |
| (insert element node (:distance-fn node))) | |
| ([element node distance-fn] |
This file contains hidden or 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
| (ns fraud.detectors.bktree) | |
| (defn root [distance-fn] {:distance-fn distance-fn :children {} :matches []}) | |
| (defn new-node [term] {:term term :children {} :matches []}) | |
| (defn empty-node? [node] | |
| (= nil (:term node))) | |
| (defn insert |
This file contains hidden or 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
| (ns fraud.detectors.bktree) | |
| (defn root [distance-fn] {:distance-fn distance-fn :children {} :matches []}) | |
| (defn new-node [term] {:term term :children {} :matches []}) | |
| (defn empty-node? [node] | |
| (= nil (:term node))) | |
| (defn insert |
This file contains hidden or 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
| def areUreturning | |
| 6%2 | |
| end |