mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
adding tests from issue #363
This commit is contained in:
parent
18b41bcda0
commit
5a770c4909
1 changed files with 16 additions and 0 deletions
|
@ -224,4 +224,20 @@
|
|||
(set-container-mutable! container-instance #t)
|
||||
(test #t (get-container-mutable container-instance)))
|
||||
|
||||
;; test child constructor sets parent field
|
||||
(let ()
|
||||
(define-record-type <parent>
|
||||
#f
|
||||
parent?
|
||||
(field1 parent-field set-parent-field!))
|
||||
(define-record-type (<child> <parent>)
|
||||
(constructor field1 field2)
|
||||
child?
|
||||
(field2 child-field))
|
||||
(let ((record (constructor 'a 'b)))
|
||||
(test 'a (parent-field record))
|
||||
(test 'b (child-field record))
|
||||
(set-parent-field! record 'c)
|
||||
(test 'c (parent-field record))))
|
||||
|
||||
(test-end))))
|
||||
|
|
Loading…
Add table
Reference in a new issue