1 ;;; -*- mode: lisp; syntax: common-lisp; coding: utf-8-unix; package: cl-mock-tests; -*-
3 (in-package #:cl-mock-tests)
5 (def-test dflet.calls-binding ()
9 (def-test dflet.notinline.works ()
10 (declare (notinline foo bar))
15 (def-test dflet.simple-mock ()
16 (defun foo (&optional (string "Hello, World!"))
22 ((equalp string "Hello, World!")
25 (is (eql 43 (foo "HELLO, WORLD!")))))
27 (def-test dflet.package-locks ()
28 "Either we can rebind LIST, or an error occurs and the binding is not
31 (handler-case (dflet ((list ()))
34 (is (eq #'list list))))))
36 (def-test dflet.package-locks.order.1 ()
48 (is (eq #'foo foo))))))
50 (def-test dflet.package-locks.order.2 ()
62 (is (eq #'foo foo))))))