Mercurial > lasercutter
view src/clojure/contrib/test_contrib/test_def.clj @ 10:ef7dbbd6452c
added clojure source goodness
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 21 Aug 2010 06:25:44 -0400 |
parents | |
children |
line wrap: on
line source
1 ;; Tests for def.clj3 ;; by Stuart Halloway5 ;; Copyright (c) Stuart Halloway, 2009. All rights reserved. The use6 ;; and distribution terms for this software are covered by the Eclipse7 ;; Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)8 ;; which can be found in the file epl-v10.html at the root of this9 ;; distribution. By using this software in any fashion, you are10 ;; agreeing to be bound by the terms of this license. You must not11 ;; remove this notice, or any other, from this software.13 (ns clojure.contrib.test-def14 (:use clojure.test)15 (:require [clojure.contrib.def :as d]))17 (defn sample-fn "sample-fn docstring" [])18 (d/defalias aliased-fn sample-fn)19 (defmacro sample-macro "sample-macro-docstring" [])20 (d/defalias aliased-macro sample-macro)22 (deftest defalias-preserves-metadata23 (let [preserved-meta #(-> % (meta) (select-keys [:doc :arglists :ns :file :macro]))]24 (are [x y] (= (preserved-meta (var x)) (preserved-meta (var y)))25 aliased-fn sample-fn26 aliased-macro sample-macro)))