Permalink
Browse files

Added some tests for the late inverter. I have it test whether it can…

… look up

the proper CLOS slot via the accessor and object.
  • Loading branch information...
smithzvk committed Jul 6, 2011
1 parent 2a4ca67 commit d908d18aca9df7e42c855204f4507b54f7c6a502
Showing with 11 additions and 0 deletions.
  1. +11 −0 modf-test.lisp
View
@@ -6,6 +6,7 @@
(deftest run-tests ()
(modf-eval-test)
(fsetf-tests)
+ (late-invert)
(test-lists)
(test-arrays)
(test-structs)
@@ -22,6 +23,16 @@
(is (equal '((1 first-second 3) second third)
ima )) ))
+(defclass late-parent () ((parent-slot :accessor parent-slot-of)))
+(defclass late-child (late-parent) ((child-slot :accessor child-slot-of)))
+
+(deftest late-invert ()
+ (let ((obj (make-instance 'late-child)))
+ (is (eql (child-slot-of (modf (child-slot-of obj) 'value)) 'value))
+ (is (eql (parent-slot-of (modf (parent-slot-of obj) 'value)) 'value)) )
+ (let ((obj (make-instance 'late-parent)))
+ (is (eql (parent-slot-of (modf (parent-slot-of obj) 'value)) 'value)) ))
+
(defsuite* lisp-types)
(deftest test-lists ()

0 comments on commit d908d18

Please sign in to comment.