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
(setq c-default-style "gnu") | |
(defun my-indent-setup () | |
(c-set-offset 'arglist-intro '+)) | |
(add-hook 'java-mode-hook 'my-indent-setup) |
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 leiningen.hooks.expand-resource-paths | |
(:use [clojure.java.io :only [as-file]]) | |
(:import [java.io File]) | |
(:require [robert.hooke] | |
[leiningen.javac] | |
[org.satta.glob :as glob])) |
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
(defmulti nan->keyword class :default :default) | |
(defmethod nan->keyword java.util.Map [m] | |
(if (instance? clojure.lang.IRecord m) | |
(nan->keyword (into {} (seq m))) | |
(let [f (fn [[k v]] [k (if (and (number? v) (Double/isNaN v)) :DoubleNaN v)])] | |
(expectations.clojure.walk/postwalk (fn [x] (if (map? x) (into {} (map f x)) x)) m)))) | |
(defmethod nan->keyword java.util.List [m] | |
(map #(if (and (number? %) (Double/isNaN %)) :DoubleNaN %) m)) |
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
(doseq [:let [a (do (println 1) 99)] | |
x [11 12]] | |
(println x a)) | |
;; output: | |
;; 1 | |
;; 11 99 | |
;; 12 99 |
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
(expect (interaction (one "hello" {:a :b :c {:dd :ee :ff :gg}})) | |
(do | |
(one "hello") | |
(one "hello" "world" "here") | |
(one "hello" {:a 1 2 3}))) |
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
(given [the-answer] | |
(expect (= 42 the-answer)) | |
42) | |
;;; or, if you want to define more context | |
(given [x y] | |
(expect x (* 2 y)) | |
42 84 | |
20 (inc (dec 10))) |
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
(given [the-answer] | |
(expect (= 42 the-answer)) | |
42) |
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
(declare *the-answer*) ; outside of a describe | |
(around [it] | |
(binding [*the-answer* 42] | |
(it))) | |
(it "knows the answer" | |
(should= 42 *the-answer*)) |
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
(define-clojure-indent | |
(expect 'defun) | |
(expect-let 'defun) | |
(given 'defun) | |
(context 1) | |
(freeze-time 1) | |
(redef-state 1) | |
(from-each 1)) |
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
;; clojure.core | |
;; 141 false greek: ⊥ - http://en.wikipedia.org/wiki/Tautology_(logic) | |
;; 163 -> key-chord: kl | |
;; 217 true greek: ⊤ - http://en.wikipedia.org/wiki/Tautology_(logic) | |
;; 255 nil greek: ∅ - http://en.wikipedia.org/wiki/Null_(mathematics) | |
;; 316 :keys key-chord: kk, greek: ӄ | |
;; testing | |
;; 224 interaction greek: ι | |
;; 265 no-op greek: ⒩ |