diff options
author | Andy Wingo <wingo@pobox.com> | 2016-09-02 09:43:42 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2016-09-02 09:43:42 +0200 |
commit | 2dbb0e212d76f08be6cd36a7b917b00deeb367cb (patch) | |
tree | 07ad7bd70c8a23613387a0efc7a0d5dba85f4f87 /test-suite | |
parent | 0f2f5949a21572fad8355473200c7adc6d74f882 (diff) | |
download | guile-2dbb0e212d76f08be6cd36a7b917b00deeb367cb.tar.gz |
GOOPS caches created vtables
* libguile/goops.c (scm_i_define_class_for_vtable): Cache created
vtables. Fixes #24286.
* test-suite/tests/goops.test ("classes for built-in types"): Add
tests.
Diffstat (limited to 'test-suite')
-rw-r--r-- | test-suite/tests/goops.test | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test-suite/tests/goops.test b/test-suite/tests/goops.test index 087b6a90a..730aabb31 100644 --- a/test-suite/tests/goops.test +++ b/test-suite/tests/goops.test @@ -149,7 +149,17 @@ ;; for which `struct-vtable-name' is #f. (is-a? (class-of (make-vtable (string-append standard-vtable-fields "prprpr"))) - <class>))) + <class>)) + + ;; Two cases: one for structs created before goops, one after. + (pass-if "early vtable class cached" + (eq? (class-of (current-module)) + (class-of (current-module)))) + (pass-if "late vtable class cached" + (let ((vtable (make-vtable + (string-append standard-vtable-fields "prprpr")))) + (eq? (class-of vtable) + (class-of vtable))))) (with-test-prefix "defining classes" |