-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-around-compile.script
More file actions
26 lines (22 loc) · 998 Bytes
/
test-around-compile.script
File metadata and controls
26 lines (22 loc) · 998 Bytes
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
;;; -*- Lisp -*-
(defun call-in-base-2 (thunk)
(let ((*read-base* 2))
(funcall thunk)))
(DBG "Testing around-compile with a function name")
(def-test-system test-around-compile
:around-compile call-in-base-2
;; :depends-on ((:version :asdf "2.017.18")) ; no :around-compile before that.
:components ((:file "test")))
(load-system 'test-around-compile :force t)
(assert-equal 3 (funcall 'add10 1)) ;; add10 must have been compiled in base 2
(fmakunbound 'add10)
(DBG "Testing around-compile with a lambda")
(def-test-system test-around-compile-lambda
:around-compile (lambda (thunk)
(let ((*read-base* 9))
(funcall thunk)))
:components ((:file "test")))
(load-system 'test-around-compile-lambda :force t)
(with-expected-failure (#+abcl (and (uiop:version= (lisp-implementation-version) "1.8.0")
"ABCL version 1.8.0"))
(assert-equal 10 (funcall 'add10 1))) ;; add10 must have been compiled in base 16