;; -*-theme-d-*-

;; Copyright (C) 2017 Tommi Höynälänmaa
;; Distributed under GNU General Public License version 3,
;; see file doc/GPL-3.

;; Expected results: translation and running OK
;; Expected output:
;;   (def . 10)
;;   (def . 10)
;;   ()
;;   ()
;;   (() . 1)
;;   (() . 1)
;;   (# . def)
;;   (# . def)
;;   (# . def)
;;   (# . abc)
;;   (# . def)
;;   (# . def)
;;   (# . def)
;;   (# . abc)
;;   #f
;;   #f


(define-proper-program (tests test566)


  (import (standard-library core)
	  (standard-library list-utilities)
	  (standard-library console-io))

  (define-class <my-class1> <object> #t #f #f public ()
    ((i <integer> public module)))

  (define-class <my-class2> <object> #f #f #f public ()
    ((i <integer> public module)))

  (define main
    (lambda (() <none> nonpure)
      (let* ((l1 '((abc . 1) (def . 10) (ghi . 100)))
	     (l2 '((() . 1) (() . 2)))
	     (x1 (make <my-class1> 10))
	     (x2 (make <my-class1> 10))
	     (x3 (make <my-class2> 100))
	     (x4 (make <my-class2> 100))
	     (x5 (make <my-class2> 200))
	     (l3 (list (cons x1 "abc") (cons x2 "def")))
	     (l4 (list (cons x3 'abc) (cons x4 'def))))
	(console-display-line (assoc 'def l1 null))
	(console-display-line (assoc-values 'def l1 null))
	(console-display-line (assoc 'x l1 null))
	(console-display-line (assoc-values 'x l1 null))
	(console-display-line (assoc null l2 null))
	(console-display-line (assoc-values null l2 null))
	(console-display-line (assoc x2 l3 #f))
	(console-display-line (assoc-values x2 l3 #f))
	(console-display-line (assoc-objects x2 l3 #f))
	(console-display-line (assoc-contents x2 l3 #f))
	(console-display-line (assoc x4 l4 #f))
	(console-display-line (assoc-values x4 l4 #f))
	(console-display-line (assoc-objects x4 l4 #f))
	(console-display-line (assoc-contents x4 l4 #f))
	(console-display-line (assoc x5 l4 #f))
	(console-display-line (assoc-values x5 l4 #f))))))
