mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
* module/oop/goops.scm (fold-class-slots): Change format to use proper slot specifications. (fold-slot-slots): Flesh out with all needed slots. (<class>): Update cons-layout to deal with new fold-class-slots form. Don't create slots; we do that later. (is-a?, get-keyword, *unbound, unbound?, %allocate-instance): Move definitions up. (<slot>, slot?): New definitions. (slot-definition-name, slot-definition-allocation) (slot-definition-init-keyword, slot-definition-init-form) (slot-definition-init-value, slot-definition-init-thunk) (slot-definition-options, slot-definition-getter) (slot-definition-setter, slot-definition-accessor) (slot-definition-slot-ref, slot-definition-slot-set!) (slot-definition-index, slot-definition-size): New definitions as accessors on <slot> objects. (class-slot-definition): Adapt to class-slots change. (direct-slot-definition-class, make-slot): New definitions. (make): Define a boot version that can allocate <slot> instances. (compute-direct-slot-definition) (compute-direct-slot-definition-initargs) (effective-slot-definition-class, compute-effective-slot-definition): New definitions. (build-slots-list): Adapt to slots being <slot> objects. (compute-get-n-set): New boot definition. (allocate-slots): New definition. Replaces compute-getters-n-setters. (%compute-layout, %prep-layout): Adapt to changes. (make-standard-class): Make <slot> objects for direct-slots, and handle the allocate-slots protocol. (<foreign-slot>): Inherit from <slot>. (get-slot-value-using-name, set-slot-value-using-name!) (test-slot-existence): Adapt to using slot definition objects. (make-class): Allow slot specs or <slot> objects as the `slots' argument. (write): New method on <slot>. (class-slot-ref, class-slot-set!): Reimplement. (compute-slot-accessors, compute-getter-method) (compute-setter-method): Adapt to changes. (compute-getters-n-setters): Remove. Yay! (compute-get-n-set): Adapt to use effective slot definitions instead of the getters-n-setters for #:class / #:each-subclass allocation. (%initialize-object): Adapt. (initialize): New method for <slot>. Adapt method for <class>. * module/oop/goops/active-slot.scm (compute-get-n-set): * module/oop/goops/composite-slot.scm (compute-propagated-get-n-set): Use slot-definition-options to access options of slot. * test-suite/tests/goops.test ("bad init-thunk"): Fix to be a "pass-if" instead of an "expect-fail". |
||
---|---|---|
.. | ||
lalr | ||
standalone | ||
test-suite | ||
tests | ||
vm | ||
ChangeLog-2008 | ||
guile-test | ||
Makefile.am | ||
README |
This directory contains some tests for Guile, and some generic test support code. To run these tests, you will need a version of Guile more recent than 15 Feb 1999 --- the tests use the (ice-9 and-let*) and (ice-9 getopt-long) modules, which were added to Guile around then. For information about how to run the test suite, read the usage instructions in the comments at the top of the guile-test script. You can reference the file `lib.scm' from your own code as the module (test-suite lib); it also has comments at the top and before each function explaining what's going on. Please write more Guile tests, and send them to bug-guile@gnu.org. We'll merge them into the distribution. All test suites must be licensed for our use under the GPL, but I don't think I'm going to collect assignment papers for them. Some test suite philosophy: GDB has an extensive test suite --- around 6300 tests. Every time the test suite catches a bug, it's great. GDB is so complicated that folks are often unable to get a solid understanding of the code before making a change --- we just don't have time. You'll see people say things like, "Here's a fix for X; it doesn't cause any regressions." The subtext is, I made a change that looks reasonable, and the test suite didn't complain, so it must be okay. I think this is terrible, because it suggests that the writer is using the test suite as a substitute for having a rock-solid explanation of why their changes are correct. The problem is that any test suite is woefully incomplete. Diligent reasoning about code can catch corner conditions or limitations that no test suite will ever find. Jim's rule for test suites: Every test suite failure should be a complete, mysterious surprise, never a possibility you were prepared for. Any other attitude indicates that you're using the test suite as a crutch, which you need only because your understanding is weak.