Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
ansi-test
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Karsten Poeck
ansi-test
Commits
87dd8f60
Commit
87dd8f60
authored
Jun 16, 2003
by
pfdietz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Begin adding tests for define-method-combination; add some cleanup tests for class-name.
parent
b7b69194
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
123 additions
and
0 deletions
+123
-0
ansi-tests/class-name.lsp
ansi-tests/class-name.lsp
+34
-0
ansi-tests/define-method-combination.lsp
ansi-tests/define-method-combination.lsp
+87
-0
ansi-tests/load-objects.lsp
ansi-tests/load-objects.lsp
+2
-0
No files found.
ansi-tests/class-name.lsp
0 → 100644
View file @
87dd8f60
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Sun Jun 15 12:05:47 2003
;;;; Contains: Tests of CLASS-NAME
(in-package :cl-test)
;;; This is mostly tested elsewhere.
(deftest class-name.1
(class-name (find-class 'symbol))
symbol)
(defclass class-name-class-01 () (a b c))
(defmethod class-name ((x class-name-class-01)) 'silly)
(deftest class-name.2
(class-name (make-instance 'class-name-class-01))
silly)
;; Tests of (setf class-name)
(deftest setf-class-name.1
(typep* #'(setf class-name) 'standard-generic-function)
t)
(deftest class-name.error.1
(classify-error (class-name))
program-error)
(deftest class-name.error.2
(classify-error (class-name (find-class 'symbol) nil))
program-error)
ansi-tests/define-method-combination.lsp
0 → 100644
View file @
87dd8f60
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Sun Jun 15 10:49:39 2003
;;;; Contains: Tests of DEFINE-METHOD-COMBINATION
(in-package :cl-test)
(define-method-combination times
:documentation "Multiplicative method combination, version 1"
:operator *)
(defgeneric dmc-gf-01 (x) (:method-combination times))
(defmethod dmc-gf-01 times ((x integer)) 2)
(defmethod dmc-gf-01 times ((x rational)) 3)
(defmethod dmc-gf-01 times ((x real)) 5)
(defmethod dmc-gf-01 times ((x number)) 7)
(defmethod dmc-gf-01 times ((x complex)) 11)
(deftest define-method-combination-01.1
(values
(dmc-gf-01 1)
(dmc-gf-01 1/2)
(dmc-gf-01 1.0)
(dmc-gf-01 #c(1 2)))
210 105 35 77)
(deftest define-method-combination-01.2
(handler-case
(eval '(locally (declare (optimize (safety 3)))
(dmc-gf-01 'x)))
(error () :good))
:good)
(defgeneric dmc-gf-02 (x) (:method-combination times))
(defmethod dmc-gf-02 times ((x integer)) 2)
(defmethod dmc-gf-02 :around ((x rational)) (1- (call-next-method)))
(defmethod dmc-gf-02 times ((x real)) 3)
(defmethod dmc-gf-02 times ((x number)) 5)
(defmethod dmc-gf-02 :around ((x (eql 1.0s0))) 1)
(deftest define-method-combination-02.1
(values
(dmc-gf-02 1)
(dmc-gf-02 1/3)
(dmc-gf-02 1.0s0)
(dmc-gf-02 13.0)
(dmc-gf-02 #c(1 2)))
29 14 1 15 5)
(defgeneric dmc-gf-03 (x) (:method-combination times))
(deftest define-method-combination-03.1
(handler-case
(progn
(eval '(defmethod dmc-gf-03 ((x integer)) t))
:bad)
(error () :good))
:good)
(deftest define-method-combination-03.2
(handler-case
(progn
(eval '(defmethod dmc-gf-03 :before ((x cons)) t))
:bad)
(error () :good))
:good)
(deftest define-method-combination-03.3
(handler-case
(progn
(eval '(defmethod dmc-gf-03 :after ((x symbol)) t))
:bad)
(error () :good))
:good)
ansi-tests/load-objects.lsp
View file @
87dd8f60
...
@@ -48,6 +48,8 @@
...
@@ -48,6 +48,8 @@
(load "next-method-p.lsp")
(load "next-method-p.lsp")
(load "call-next-method.lsp")
(load "call-next-method.lsp")
(load "compute-applicable-methods.lsp")
(load "compute-applicable-methods.lsp")
(load "define-method-combination.lsp")
(load "find-method.lsp")
(load "find-method.lsp")
(load "add-method.lsp")
(load "add-method.lsp")
(load "unbound-slot.lsp")
(load "unbound-slot.lsp")
(load "class-name.lsp")
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment