Test output for protobj [ok]
Testing time: 3s
/home/mario/local/chicken-4.8.0.3/bin/csi -script run.scm < /dev/null ;;; BEGIN "Protobj" TESTS ;; DEFINE: Object "a" (define a (%)) ;; 1. "a" parent is root (eq? (^ a) (current-root-object)) ;; ==> #t ;; Passed. ;; EVAL: Add to "a" slot "x" value 1 (! a x 1) ;; ==> #<unspecified> ;; 2. "a" slot "x" is 1 (? a x) ;; ==> 1 ;; Passed. ;; DEFINE: Object "b" clones "a" (define b (% a)) ;; 3. "b" inherited slot "x" is 1 (? b x) ;; ==> 1 ;; Passed. ;; EVAL: Set "a" slot "x" to 42 (! a x 42) ;; ==> #<unspecified> ;; 4. "b" slot "x" is now 42 (? b x) ;; ==> 42 ;; Passed. ;; EVAL: Set "b" slot "x" to 69 (! b x 69) ;; ==> #<unspecified> ;; 5. "b" slot "x" is 69 (? b x) ;; ==> 69 ;; Passed. ;; 6. "a" slot "x" is still 42 (? a x) ;; ==> 42 ;; Passed. ;; EVAL: Add to object "a" an "xplus" slot containing a method (! a xplus (lambda (self n) (+ (? self x) n))) ;; ==> #<unspecified> ;; 7. 42 + 7 = 49 (@ a xplus 7) ;; ==> 49 ;; Passed. ;; 8. 69 + 7 = 76 (@ b xplus 7) ;; ==> 76 ;; Passed. ;; 9. 42 + 7 = 49 (@ a (xplus 1000) (xplus 7)) ;; ==> 49 ;; Passed. ;; DEFINE: Object "c" clones "a", adds slot "y" (define c (% a (y 101))) ;; 10. "c" slot "x" is 42 (? c x) ;; ==> 42 ;; Passed. ;; 11. "c" slot "y" is 101 (? c y) ;; ==> 101 ;; Passed. ;; DEFINE: Object "d" clones "a", adds slots (define d (% a (x 1) (y 2) (z 3))) ;; 12. "d" slot "x" is 1 (? d x) ;; ==> 1 ;; Passed. ;; 13. "d" slot "y" is 2 (? d y) ;; ==> 2 ;; Passed. ;; 14. "d" slot "z" is 3 (? d z) ;; ==> 3 ;; Passed. ;;; END "Protobj" TESTS: PASSED ;;; (Total: 14 Passed: 14 Failed: 0)