#!/bin/sh
. ./expect.sh
use_test_subdirectory
tmpfilename="$TEST_FILESTEM.lisp"
cat > $tmpfilename <<EOF
(in-package :cl-user)
;; This definition has too many qualifiers, so loading the
;; DEFMETHOD should fail.
(defmethod zut progn :around ((x integer)) (print "integer"))
(zut 1)
EOF
expect_load_error $tmpfilename
cat > $tmpfilename <<EOF
(in-package :cl-user)
(defgeneric zut (x) (:method-combination progn))
;; This definition is missing the PROGN qualifier, and so the
;; DEFMETHOD should fail.
(defmethod zut ((x integer)) (print "integer"))
(zut 1)
EOF
expect_load_error $tmpfilename
cat > $tmpfilename <<EOF
(in-package :cl-user)
(defgeneric zut (x) (:method-combination progn))
;; This definition has too many qualifiers, so loading the
;; DEFMETHOD should fail.
(defmethod zut progn :around ((x integer)) (print "integer"))
(zut 1)
EOF
expect_load_error $tmpfilename
cat > $tmpfilename <<EOF
(in-package :cl-user)
(defclass another-class-with-slots ()
(a-new-slot-name))
(defun foo (x)
(values (setf (slot-value x 'a-new-slot-name) 2)
(slot-value x 'a-new-slot-name)))
EOF
expect_clean_compile $tmpfilename
cat > $tmpfilename <<EOF
(defpackage "INT"
(:use "CL")
(:export "EX"))
(in-package "INT")
(defclass ex ()
((a-slot :initarg :a-slot)))
(in-package :cl-user)
(handler-bind ((warning (lambda (c) (error "caught warning: ~A" c))))
(defclass why (int:ex)
((a-slot :initarg :a-slot)))
(sb-mop:finalize-inheritance (find-class 'why)))
EOF
expect_clean_cload $tmpfilename
exit $EXIT_TEST_WIN