diff options
author | William Carroll <wpcarro@gmail.com> | 2020-01-24T10·50+0000 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2020-01-24T10·50+0000 |
commit | b6fa3941b3731e959a7f54bf8e68e43e9077bf90 (patch) | |
tree | 452755fd80776fe60d879578c310ae7baffc59e9 /lisp | |
parent | 6108f8df0140e2f71c9f9b50d530d16400d9cdcb (diff) |
Rename common-lisp directory to lisp
I could have renamed common-lisp to common_lisp. I think Nix prefers underscores to hyphens.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/default.nix | 16 | ||||
-rw-r--r-- | lisp/main.lisp | 15 | ||||
-rw-r--r-- | lisp/unit-testing.lisp | 13 |
3 files changed, 44 insertions, 0 deletions
diff --git a/lisp/default.nix b/lisp/default.nix new file mode 100644 index 000000000000..0969c7abf7e2 --- /dev/null +++ b/lisp/default.nix @@ -0,0 +1,16 @@ +{ depot ? import <depot> {}, + universe ? import <universe> {}, + ... +}: + +depot.nix.buildLisp.program { + name = "unit-testing"; + + deps = with universe.third_party.lisp; [ + prove + ]; + + srcs = [ + ./unit-testing.lisp + ]; +} diff --git a/lisp/main.lisp b/lisp/main.lisp new file mode 100644 index 000000000000..2c4a5a411635 --- /dev/null +++ b/lisp/main.lisp @@ -0,0 +1,15 @@ +(in-package #:cl-user) +(defpackage #:utils + (:documentation "Some utility functions and macros to wet my beak.") + (:use #:cl) + (:shadow #:type)) +(in-package #:utils) + +(defmacro type (name in out) + `(declaim (ftype (function ,in ,out) ,name))) + +(defmacro comment (&rest _forms) nil) + +(type add (int int) int) +(defun add (a b) + (+ a b)) diff --git a/lisp/unit-testing.lisp b/lisp/unit-testing.lisp new file mode 100644 index 000000000000..c0b3be9b4515 --- /dev/null +++ b/lisp/unit-testing.lisp @@ -0,0 +1,13 @@ +(in-package #:cl-user) +(defpackage #:my-test + (:documentation "Unit testing in Common Lisp.") + (:use #:cl)) +(in-package #:my-test) + +(plan 3) + +(ok (not (find 4 '(1 2 3)))) +(is 4 4) +(isnt 1 #\1) + +(finalize) |