File: asdf-finalizers-test.lisp

package info (click to toggle)
cl-asdf-finalizers 20170403-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 104 kB
  • ctags: 46
  • sloc: lisp: 294; makefile: 13
file content (37 lines) | stat: -rw-r--r-- 1,270 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#+xcvb (module (:depends-on ("asdf-finalizers" (:asdf "hu.dwim.stefil"))))

(defpackage :asdf-finalizers-test
  (:use :cl :fare-utils :asdf-finalizers :hu.dwim.stefil :list-of))

(in-package :asdf-finalizers-test)

;;; Testing the asdf-finalizers library.

(defsuite* (test-suite
            :in root-suite
            :documentation "Testing asdf-finalizers"))

(defun transpose (x)
  (check-type x (list-of (list-of integer)))
  (apply 'mapcar 'list x))

(deftest test-list-of ()
  (is (typep '(nil t t nil) '(list-of boolean)))
  (is (not (typep '(nil t 1 nil) '(list-of boolean))))
  (is (not (typep '(nil t t nil . 1) '(list-of boolean))))
  (is (typep '(1 2 3 4) '(list-of integer)))
  (is (not (typep '(1 2 3 4) '(list-of nil))))
  (is (typep nil '(list-of nil)))
  (is (equal (transpose '((1 2) (3 4))) '((1 3) (2 4))))
  nil)

(typep '(1 2 3) '(list-of string))

(eval-when (:compile-toplevel :load-toplevel :execute)
  (typep '(1 2 3) '(list-of symbol)))

(final-forms)

#| Manual test: in a fresh Lisp,
(require "asdf")(asdf:load-system :asdf-finalizers :force t)(trace asdf-finalizers:eval-at-toplevel asdf-finalizers:register-final-form)(setf asdf-finalizers::*debug-finalizers* t)(asdf:load-system :asdf-finalizers-test :force '(:asdf-finalizers-test))
|#