1 ;;; 8sync --- Asynchronous programming for Guile
2 ;;; Copyright (C) 2017 Christopher Allan Webber <cwebber@dustycloud.org>
3 ;;; Copyright (C) 2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
5 ;;; This file is part of 8sync.
7 ;;; 8sync is free software: you can redistribute it and/or modify it
8 ;;; under the terms of the GNU Lesser General Public License as
9 ;;; published by the Free Software Foundation, either version 3 of the
10 ;;; License, or (at your option) any later version.
12 ;;; 8sync is distributed in the hope that it will be useful,
13 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU Lesser General Public License for more details.
17 ;;; You should have received a copy of the GNU Lesser General Public
18 ;;; License along with 8sync. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (tests test-rmeta-slot)
21 #:use-module (srfi srfi-64)
22 #:use-module (8sync rmeta-slot)
23 #:use-module (oop goops)
24 #:use-module (tests utils))
26 (test-begin "test-rmeta-slot")
29 (define-class <kah-lassy> ()
30 (entries #:allocation #:each-subclass
37 (class-rmeta-ref <kah-lassy> 'entries 'foo))
39 (class-rmeta-ref <kah-lassy> 'entries 'baz))
43 (define-class <sub-lassy> (<kah-lassy>)
44 (entries #:allocation #:each-subclass
48 (peanut . "gallery")))))
50 ;; Access values, and inheritance is preserved
52 (class-rmeta-ref <sub-lassy> 'entries 'foo))
54 (class-rmeta-ref <sub-lassy> 'entries 'peanut))
56 (class-rmeta-ref <sub-lassy> 'entries 'baz))
60 (class-rmeta-ref <sub-lassy> 'entries 'not-defined))
61 ;; Not defined, with default
63 (class-rmeta-ref <sub-lassy> 'entries 'not-defined
67 (test-end "test-rmeta-slot")